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

Identify, Select fail on geojson mapsources when property is null #652

Open
brentfraser opened this issue May 26, 2021 · 12 comments
Open

Identify, Select fail on geojson mapsources when property is null #652

brentfraser opened this issue May 26, 2021 · 12 comments

Comments

@brentfraser
Copy link
Contributor

brentfraser commented May 26, 2021

At least I think that is the problem. To test use geojson files in geomoose/gm3-demo-data#8

@theduckylittle
Copy link
Member

Can you get me some more details here? I've tried corrupting a few files in order try to recreate. I tried:

  • A null property value, that seems to just render as the string "null".
  • Uneven properties (some features with some properties and some with others) and they seem to work okay.
  • A false property value, again, just seems to render the string "false"

When I eliminate all properties, the feature does not render at all, which is maybe expected?

@brentfraser
Copy link
Contributor Author

Hmm, yes I should have supplied more details. So here's what i did today:

  1. load a GeoMoose site with a sketch layer with an upload tool.
  2. Upload gm3-demo-data/demo/census/census_cities.geojson file
  3. Do Identify on "Farmington" polygon
  • Note no feature is found (bad, I expected to find one feature and show properties)
    The other city polygons work as expected.

@brentfraser
Copy link
Contributor Author

Looking at the census_cities.geojson in a text editor , all the properties for Farmington look ok (and no nulls), so I'm not sure why it fails.

@brentfraser
Copy link
Contributor Author

Looks like it is bad (?) geometry for the holes in the Farminton polygon. Looking at the ogr2ogr command I used (https://github.com/geomoose/gm3-demo-data/tree/main/demo/census), I may need to specify -nlt MULTIPOLYGON

@theduckylittle
Copy link
Member

Digging in a little, I'm seeing the queryVectorLayer function return no features from OpenLayer's forEachFeatureAtCoordinateDirect call. Since other features work, I don't believe there to be a mismatched projection issue, and could be due to the malformed Geometry. But it's a bug in OpenLayers that we would need to investigate (locally I have version 6.9.0 installed).

@brentfraser
Copy link
Contributor Author

In the mean time, I'm OK with just saying to users "make sure your geometry is valid"

@brentfraser
Copy link
Contributor Author

and I thought I had filed an Issue on "Can't do identify on point or line in Drawing and Markup". Maybe it's buried in another Issue...

@theduckylittle
Copy link
Member

It looks as if we drop the -nlt Polygon from the creation script, all is well.

Should we create a separate MR to fix our data? I suspect that this is garbage-in-is-garbage-out and there won't be much of a way for us to assist the user in that case.

@brentfraser
Copy link
Contributor Author

Yes, I need to fix it and do a PR.

@brentfraser
Copy link
Contributor Author

Looking at the history of the files in gm3-demo-data, i had originally used MULTIPOLYGON, but after loading the data into GeoServer inserts were a problem.

@theduckylittle
Copy link
Member

🤔 That's interesting. I would think it would have an issue with mixed types (say Polygons and MultiePolygons) but usually a single time doesn't phase it.

@brentfraser
Copy link
Contributor Author

It could have been GM was telling it to insert a POLYGON and GeoServer expected MULTIPOLYGON only? Maybe there is a "promote geometry" switch in GeoServer...

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

No branches or pull requests

2 participants