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

wkt_to_geojson not working when booth coordinates are negatives? #5

Open
ZDidier opened this issue Jan 25, 2021 · 3 comments
Open

wkt_to_geojson not working when booth coordinates are negatives? #5

ZDidier opened this issue Jan 25, 2021 · 3 comments

Comments

@ZDidier
Copy link

ZDidier commented Jan 25, 2021

OK

wkt = 'POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))'
print(convert.wkt_to_geojson(wkt))

OK

wkt = 'POLYGON ((30.5 10.3, -40.5 40.1, 20.5 40.3, 10.5 20.6, 30.5 10.3))'
print(convert.wkt_to_geojson(wkt))

KO

wkt = 'POLYGON ((30.5 10.3, -40.5 -40.1, 20.5 40.3, 10.5 20.6, 30.5 10.3))'
print(convert.wkt_to_geojson(wkt))
ValueError: POLYGON ((30.5 10.3, -40.5 -40.1, 20.5 40.3, 10.5 20.6, 30.5 10.3)) is not a WKT string

@i21510
Copy link

i21510 commented Mar 11, 2021

In fact, it doesn't seem to work with negatives coordinates at all

@probinso
Copy link

probinso commented Jul 28, 2022

I suspect that this is a continuation of this issue. I'll just add my failing example.

wkt = 'POLYGON ((-153.7637604628186 70.64158670328457, -152.7804213168429 69.57675927338664, -143.5388203961125 70.28750982071695, -144.0363194550571 71.37897101025709, -153.7637604628186 70.64158670328457))'
convert.wkt_to_geojson(wkt)
{
    'exception': 'ValueError',
    'exceptionMessage': 'POLYGON ((-153.7637604628186 70.64158670328457, -152.7804213168429 69.57675927338664, -143.5388203961125 70.28750982071695, -144.0363194550571 71.37897101025709, -153.7637604628186 70.64158670328457)) is not a WKT string'
}

@simonprickett
Copy link

I'm also seeing the same issue when working with real world coords:

raise ValueError('{} is not a WKT string'.format(wkt))
ValueError: POLYGON ((-6.328125 55.24155203565252,-5.888671875 55.32914440840507,-5.592041015625 55.29162848682989,-5.47119140625 55.70235509327093,...

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

4 participants