django-gisserver 2.2.0__py3-none-any.whl → 2.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-gisserver
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Django speaking WFS 2.0 (exposing GeoDjango model fields)
5
5
  Home-page: https://github.com/amsterdam/django-gisserver
6
6
  Author: Diederik van der Boor
@@ -1,5 +1,5 @@
1
- django_gisserver-2.2.0.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
2
- gisserver/__init__.py,sha256=N7STxpDjd2Gy8Zv7HsUf5L8bEDZQl1TW0x2ebcVtO4Q,40
1
+ django_gisserver-2.2.2.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
2
+ gisserver/__init__.py,sha256=FiIUkBAQzSsfZ3bs8XQLYkfb2mLfi49gQVU4FmNlSMs,40
3
3
  gisserver/compat.py,sha256=qmLeT7wGRIyA2ujUtVEuUX7qgr98snak9b5OTvnkhas,451
4
4
  gisserver/conf.py,sha256=Bb2hbLx1SM4la6-e8PrBQ7dg2z3Z1sopOlaTrfa6gbg,3666
5
5
  gisserver/crs.py,sha256=ChqLNZCHBCZmXphjJTT22jvhyMIwAAFtFSjwbH4Bigk,18330
@@ -17,8 +17,8 @@ gisserver/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
17
17
  gisserver/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  gisserver/management/commands/loadgeojson.py,sha256=lmvxXFEVGOWRELLB3u7M3hiJg2TQEICJOatdHLw8toI,12130
19
19
  gisserver/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- gisserver/operations/base.py,sha256=SP3PV78bIFCeCQxEFMqIhj0YBjn1g6UqhyoK_Ub4ZxU,10113
21
- gisserver/operations/wfs20.py,sha256=r_2dcqzN5xw2LIOVE7Ofe93t9GvNx7ESFWKRnnW10Y4,20964
20
+ gisserver/operations/base.py,sha256=Ecb4ZqqT0Tb2rY-qDDqv293xQWvuhiHR6x1QrAUX3yU,10743
21
+ gisserver/operations/wfs20.py,sha256=4NduwMgJVT37CGMRGpW5cKWQkv-s-L_P52xEatC_8HU,21257
22
22
  gisserver/output/__init__.py,sha256=1-bzgNq1yGuWGse2zLXUwTnR7-FpfosGCzDm97diKRM,1133
23
23
  gisserver/output/base.py,sha256=igcOhjJkziPlpPJjwfyyC0S1LHfRI8Em-UMNnX5Lk-E,11247
24
24
  gisserver/output/csv.py,sha256=1Bz3o3-dvdEFWWLrDj-cxCp7My6IMMakmwAZIfPsjc4,6906
@@ -63,7 +63,7 @@ gisserver/templates/gisserver/wfs/feature_type.html,sha256=Kl_0c7nnlc7Z1bzJOq8v7
63
63
  gisserver/templates/gisserver/wfs/2.0.0/get_capabilities.xml,sha256=SGZSn7cDU_Oai6d45xrkqhax5CPyI1oIc8BZLOEw1X4,8695
64
64
  gisserver/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  gisserver/templatetags/gisserver_tags.py,sha256=L2YG-PxiKR0QWBMRLLrL_VR94p6wCb5HzgnrPMg4hug,995
66
- django_gisserver-2.2.0.dist-info/METADATA,sha256=_G1iWkU3srwwY0h0zdXHEKbFK_ytWs9ZBq3uneOkd4Y,6731
67
- django_gisserver-2.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
- django_gisserver-2.2.0.dist-info/top_level.txt,sha256=8zFCEMmkpixE4TPiOAlxSq3PD2EXvAeFKwG4yZoIIOQ,10
69
- django_gisserver-2.2.0.dist-info/RECORD,,
66
+ django_gisserver-2.2.2.dist-info/METADATA,sha256=tgpm8eLr6tvT0CEcE235oBOYqV5BKZf-Q51G5KapNzQ,6731
67
+ django_gisserver-2.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
+ django_gisserver-2.2.2.dist-info/top_level.txt,sha256=8zFCEMmkpixE4TPiOAlxSq3PD2EXvAeFKwG4yZoIIOQ,10
69
+ django_gisserver-2.2.2.dist-info/RECORD,,
gisserver/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.2.0" # follows PEP440
1
+ __version__ = "2.2.2" # follows PEP440
@@ -96,12 +96,32 @@ class OutputFormat(typing.Generic[R]):
96
96
  self._max_page_size = max_page_size
97
97
 
98
98
  def matches(self, value):
99
- """Test whether the 'value' is matched by this object."""
100
- if self.content_type == "application/gml+xml":
101
- # Allow "application/gml+xml; version=3.2" as sent by FME.
102
- # TODO rewrite this matching code in a clean way.
103
- value = value.split("; ", 1)[0]
104
- return self.content_type == value or self.subtype == value
99
+ """
100
+ Test whether the 'value' is matched by this object.
101
+
102
+ The regex used captures the content-type (ct), subtype (st), charset (cs) and version (v)
103
+ from the supplied value.
104
+
105
+ Some possible input values are:
106
+ - application/gml+xml
107
+ - application/gml+xml; version=3.2
108
+ - csv
109
+ - text/csv
110
+ - application/json; subtype=geojson; charset=utf-8
111
+ - geojson
112
+ """
113
+
114
+ regex = (
115
+ r"^(?P<ct>[^;]+);?\s?(?:(?:subtype=)(?P<st>[^;]*))?;?\s?"
116
+ r"(?:(?:charset=)(?P<cs>.*))?(;\s)?(?:(?:version=)(?P<v>.*))?"
117
+ )
118
+ if match := re.match(regex, value):
119
+ # If we capture a subtype, match on both
120
+ if match.group("st") is not None:
121
+ return self.content_type == match.group("ct") and self.subtype == match.group("st")
122
+ else:
123
+ return self.content_type == match.group("ct") or self.subtype == match.group("ct")
124
+ return False
105
125
 
106
126
  @property
107
127
  def identifier(self):
@@ -473,6 +473,14 @@ class GetFeature(BaseWFSGetDataOperation):
473
473
 
474
474
  return result
475
475
 
476
+ def get_parameters(self) -> list[Parameter]:
477
+ """Extend Parameters with outputFormat to support ArcGISOnline."""
478
+ parameters = super().get_parameters()
479
+
480
+ return parameters + [
481
+ Parameter("outputFormat", allowed_values=self.get_output_formats()),
482
+ ]
483
+
476
484
 
477
485
  class GetPropertyValue(BaseWFSGetDataOperation):
478
486
  """This returns a limited set of properties of the feature.