Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GeneratedField as geometry field #32

Open
tomdtp opened this issue Jul 11, 2024 · 1 comment
Open

Allow GeneratedField as geometry field #32

tomdtp opened this issue Jul 11, 2024 · 1 comment

Comments

@tomdtp
Copy link
Contributor

tomdtp commented Jul 11, 2024

We have some larger polygons in our database and in order to simplify calculations etc we have a GeneratedField, which builds a simplified version of the polygon.

geometry = models.MultiPolygonField(default=None, null=True)
geometry_simplified = models.GeneratedField(
    expression=Multi(SimplifyPreserveTopology("geometry", 0.0001)),
    output_field=models.MultiPolygonField(),
    db_persist=True,
)

I would really like to use this as geometry column for our WFS, but it is throwing an error:

django.core.exceptions.ImproperlyConfigured: FeatureType 'model' does not expose a geometry field.

I looked at the code and could not quickly come up with a PR, maybe someone of the team can look into this?

@vdboor
Copy link
Contributor

vdboor commented Sep 9, 2024

Hi! Thanks for reporting this issue. I didn't see this option before.

It will take some time to have this issue scheduled. Totally understand it was tricky to find the source of the Django field translation into the internal XSD definitions. For anyone who likes to take a look, it happens here:

def get_basic_field_type(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants