Opened 8 years ago

Closed 8 years ago

#27973 closed Bug (fixed)

LinearRing.json gives invalid GeoJSON

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: GIS Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In [1]: from django.contrib.gis.geos import GEOSGeometry

In [2]: aruba = GEOSGeometry('SRID=4326;LINEARRING (-69.89912109375 12.45200195312499, -69.895703125 12.42299804687499, -69.94218749999999 12.43852539062499, -70.004150390625 12.50048828125, -70.0661
   ...: 1328125 12.54697265624999, -70.05087890624999 12.59707031249999, -70.035107421875 12.61411132812499, -69.97314453125 12.567626953125, -69.91181640625 12.48046875, -69.89912109375 12.452001953
   ...: 12499)')

In [3]: aruba.json
Out[3]: '{"coordinates": [[-69.89912109375, 12.45200195312499], [-69.895703125, 12.42299804687499], [-69.94218749999999, 12.43852539062499], [-70.004150390625, 12.50048828125], [-70.06611328125, 12.54697265624999], [-70.05087890624999, 12.59707031249999], [-70.035107421875, 12.61411132812499], [-69.97314453125, 12.567626953125], [-69.91181640625, 12.48046875], [-69.89912109375, 12.45200195312499]], "type": "LinearRing"}'

This GeoJSON is not valid as GeoJSON standard doesn't define LinearRing type.
GeoJSON validity could be checked here: http://geojsonlint.com/

Change History (5)

comment:1 by Sergey Fedoseev, 8 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Sergey Fedoseev, 8 years ago

Has patch: set

comment:3 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 4bc3550:

Fixed #27973 -- Fixed GeoJSON representation of LinearRing and custom GEOSGeometry subclasses.

Note: See TracTickets for help on using tickets.
Back to Top