-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unexpected GeoJSON rectangles (type:"Polygon") on Mercator projection #1405
Comments
Seems like it is the same on d3. bl.ock |
Looks like this may be an issue for d3-geo. Vega doesn't do any custom processing of the GeoJSON here, it hands it off to the d3-geo projections and path utilities. I do notice some different results if I adjust the |
I'm afraid that I'm not familiar with d3 to file issue :) all my experience is limited by copypasting Mike Bostock’s Block with my data. :( Could you push issue downstream to d3.geo? |
It comes that d3.geo uses some GeoJSON-like format, that is not conforms current specification rfc7946.
So somewhere data should be converted from rfc7946 GeoJSON to d3.geo format. And a question is where? I can do it on my side but it will mean that vega does not conform GeoJSON specification too. |
I have found an example workarounds:
I think that format suggested in #1319 could be extended with coordinates. For being it could be just a label (rfc and d3) then it can be extended with formal description of coordinate system object. "format": {
"type": "geojson",
"feature": "features", // like topojson or jpath
"properties": "foreign" // default value "nested"
"coordinates": "rfc7946" // default value "d3geo"
} @jheer would you accept a PR for that or it out of scope? |
Yes, I'd be happy to receive and review a PR along these lines! The right place to start would be the vega/vega-loader repo, which contains all the format processing logic. One might add a dedicated |
While exploring issue I made synthetic geojson to determine the problem.
Synthetic GeoJSON data
A bit strange results of Vega (left), I expected the same I can get with
leaflet.js
(right).You can reproduce issue in vega editor or check bl.ock with both charts and dataset.
Summary of existing differences:
id: 2
) intentionally contains invalid point[-110.0, -100.0]
.Leaflet.js
clips it on the south with valid limit. Vega moves it to north and that causes wrong image in case of insignificant rounding errors as you can see in issue wrong 'Antarctica' iliatimofeev/gpdvega#1Vega source
The text was updated successfully, but these errors were encountered: