Comments (6)
The documentation looks wrong. And i'm not sure the Deserializer
is really tested because it looks like there is an exception which is not imported..
From looking through the tests, I'd say that you would need to do something like:
>>> from django.core import serializers
>>> serializers.deserialize('geojson', your_geojson)
Can you tell me if this works? Thanks.
from django-geojson.
I ran into the same error as @easherma when trying to de-serialize some GeoJSON that was returned from a geocoder API.
I tried @Gagaro's suggestion but it resulted in a different error:
{SerializerDoesNotExist}'geojson is a serialization-only serializer'
That's a pity. So far as I can tell there's no other library that will attempt to nicely convert some valid GeoJSON into a spatially aware Django model. Luckily I'm working with points so it's pretty easy to just parse them out from the JSON. But such a thing could be useful for more complex feature collections.
from django-geojson.
The thing is we do have a deserializer in the tests: https://github.com/makinacorpus/django-geojson/blob/master/djgeojson/tests.py#L69-L131
We also have a Deserializer
method, maybe you could try that one: https://github.com/makinacorpus/django-geojson/blob/master/djgeojson/serializers.py#L479-L521
I'm not sure what's up with all this.
from django-geojson.
I haven't been able to use the Deserializer class. Will keep trying though.
This part of the documentation is wrong,
https://django-geojson.readthedocs.io/en/latest/advanced.html#low-level-deserializer
probably outdated right?
from django-geojson.
Would be nice to at least fix the docs. This was my first experience of using the whole makinacorpus Geodjango stack and it didn't inspire immediate confidence!
from django-geojson.
It seems to be that was never implemented
from django-geojson.
Related Issues (20)
- UWSGI crashes after installing django-geojson HOT 2
- 'Shop' object has no attribute 'geom'
- JSONFormField is removed from jsonfield HOT 1
- Leaflet widget is not rendered automatically for forms.Forms HOT 4
- Generate FeatureCollection GeoJSON from queryset in the database
- Daes it make sense to improve validators process? HOT 2
- jsonfield dependency still required? HOT 1
- Error creating geometry from value 'null' (String input unrecognized as WKT EWKT, and HEXEWKB.) HOT 2
- Make 'name' the default for 'crs_type' HOT 3
- Leaflet warning when using own widget HOT 1
- Migration breakage when switching from 'jsonfield' to django.db.models.JSONField
- OSError exception HOT 2
- GeoJSONLayerView and LoginRequiredMixin HOT 5
- Django 2.0: AttributeError: 'CharField' object has no attribute 'rel' HOT 3
- How I Can Add Circle Support In Geometry Type HOT 1
- Support Model methods with no parameters HOT 1
- Serving geoJson with custom coordinates HOT 1
- Makemigrations Failing - Could not find GDAL. HOT 1
- Object has no attribute 'geom' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-geojson.