makinacorpus / django-geojson

django-geojson is a collection of helpers to (de)serialize (Geo)Django objects into GeoJSON.
GNU Lesser General Public License v3.0
259 stars 69 forks source link

Daes it make sense to improve validators process? #112

Closed FelipeSBarros closed 3 years ago

FelipeSBarros commented 3 years ago

Hello there! First of all, thanks for creating and maintaining this package. It's really useful. I am new to django and I am using the dji geojson to study and dig in web development for geo without needing PostGIS.

So I started exploring only djgeojson, without using the django-leaflet widget. And I could realize that I could save a Polygon json data on a PointField. Beyond that I could save a json pretending being a polygon but with only one pair of coordinates.

Looking in the repository I could see that there are some validations, but most of them related to the kind of "geometry".

So, I am wandering if make any sense to improve the validations by including, for instance, if a PolygonField has at least tree pairs of coordinates, and its first and last pairs area equals.

If you believe that yes, it makes sense, I would be happy to collaborate on this. Best regards Felipe

Gagaro commented 3 years ago

Yes it would probably be better.

In that case, we should probably rely on a package that does it for us (https://pypi.org/project/geojson/#validation?).

Feel free to do a PR. I'll gladly review it.

FelipeSBarros commented 3 years ago

Hi, @Gagaro

In that case, we should probably rely on a package that does it for us (https://pypi.org/project/geojson/#validation?).

Ah, that's great to know that there is an solution already implemented. I didn't know that. Probably all validation I was imagining is already there. I will take a look and, if necessary, reach back. Thanks.