Re: [Django] #15529: GeoJSON regexes doesn't accept some characters within a quoted string

7 views
Skip to first unread message

Django

unread,
Sep 9, 2011, 1:28:00 AM9/9/11
to django-...@googlegroups.com
#15529: GeoJSON regexes doesn't accept some characters within a quoted string
-------------------------------------+-------------------------------------
Reporter: woutkh | Owner: jbronn
Type: Bug | Status: assigned
Milestone: 1.4 | Component: GIS
Version: 1.2 | Severity: Normal
Resolution: | Keywords: gis geojson gdal
Triage Stage: Accepted | json_regex
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 1
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by jpaulett):

* ui_ux: => 0
* easy: => 0


Comment:

What about actually attempting to decode the JSON (json.loads) and catch
the ValueError when it is not valid?

{{{
def is_json(geom_input):
try:
json.loads(geom_input)
return True
except ValueError:
return Fals
}}}

The major downside is that we are loading a (potentially large) GeoJSON
object that will never be used. The regex is fast, but has corner cases.

--
Ticket URL: <https://code.djangoproject.com/ticket/15529#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 6, 2012, 10:27:53 AM10/6/12
to django-...@googlegroups.com
#15529: GeoJSON regexes doesn't accept some characters within a quoted string
-------------------------------------+-------------------------------------
Reporter: woutkh | Owner: jbronn
Type: Bug | Status: assigned
Component: GIS | Version: 1.2
Severity: Normal | Resolution:
Keywords: gis geojson gdal | Triage Stage: Accepted
json_regex | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by claudep):

* needs_tests: 1 => 0


Comment:

Just uploaded a patch with a test, if we want to keep going the regex
route.

--
Ticket URL: <https://code.djangoproject.com/ticket/15529#comment:7>

Django

unread,
Oct 31, 2013, 1:18:09 PM10/31/13
to django-...@googlegroups.com
#15529: GeoJSON regexes doesn't accept some characters within a quoted string
-------------------------------------+-------------------------------------
Reporter: woutkh | Owner: jbronn
Type: Bug | Status: closed
Component: GIS | Version: 1.2
Severity: Normal | Resolution: fixed

Keywords: gis geojson gdal | Triage Stage: Accepted
json_regex | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"c64efe37345cc632e24beb8c7e2a81ef5d3713ba"]:
{{{
#!CommitTicketReference repository=""
revision="c64efe37345cc632e24beb8c7e2a81ef5d3713ba"
Fixed #15529 -- More permissive geojson syntax in constructor

Thanks Wouter Klein Heerenbrink for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15529#comment:8>

Reply all
Reply to author
Forward
0 new messages