Closed 3nids closed 5 months ago
can you share the use case more in detail please?
I want to publish a table which has no geometry column as geo json so it can be read in QGIS (as OGC API Feature layer).
Therefore, it would be handy to use the same serializer than for the tables with geometry columns rather than implementing my own serializer to get a valid geo json output.
For the moment, I'm creating an empty geometry column as a hack:
class MyValueList(models.Model):
id = models.CharField(primary_key=True, max_length=10)
# Null geometry to satisfy the interface expected from
# model by GeoFeatureModelSerializer
geom = gis_models.PointField(null=True, blank=True)
active = models.BooleanField(default=True)
value = models.CharField(max_length=255, null=True, blank=True)
description = models.TextField(null=True, blank=True)
Basically, allowing geometry-less layer in DRF-gis would allow us to be compliant with OGC API Features norm to publish geometry less layers.
I am open to contributions in this regard.
I never had such a use case but we can definitely merge a patch which would add support for it.
🎉
@nemesifier Thanks a lot!
Looking for this to be released: do you know if there is a roadmap or a release schedule?
Is there a way to use
GeoFeatureModelSerializer
for a geometry-less table? I am trying to publish a value list table.Something like
geo_field = None
is what I was expecting.Thanks in advance for any feedback!