#26138: Example for GeoJSON Serializer don't work as described --------------------------------------+-------------------- Reporter: brot | Owner: nobody Type: Cleanup/optimization | Status: new Component: GIS | Version: 1.9 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+-------------------- The example in the documentation for GeoJSON Serializer don't work as described. https://docs.djangoproject.com/es/1.9/ref/contrib/gis/serializers/
The tuple for the fields option is missing the 'point' field {{{ from django.core.serializers import serialize from my_app.models import City serialize('geojson', City.objects.all(), geometry_field='point', fields=('name', 'point')) }}} If you use the example without the 'point' in the fields tuple the returning geometry property is null {{{ { 'type': 'FeatureCollection', 'crs': { 'type': 'name', 'properties': {'name': 'EPSG:4326'} }, 'features': [ { 'type': 'Feature', 'geometry': null, 'properties': { 'name': 'Chicago' } } ] } }}} I think there should be a test-case in https://github.com/django/django/blob/master/tests/gis_tests/geoapp/test_serializers.py with a call to serialize used with both parameters (geometry_field and fields) -- Ticket URL: <https://code.djangoproject.com/ticket/26138> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/047.6f709ccf9e9363c3d211e7f340daa834%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.