1

I have this image that I want to convert it to GeoJSON.

Image to convert

And I have this World File:

0.0388048118
0.0
0.0
-0.0387897595
697054.11331
4458020.56656

When I try to run the gdal_polygonize command from terminal, it pixelizes the json, but If I try to run it without the World File it works very well:

gdal_polygonize.py -f "GeoJSON" image.png out.json

What can I do to make it work with the World File? I need the coordinates, so I can't run it without that file... Is there any alternative to gdal_polygonize?

EDIT

This is what I should get. This GeoJSON has been created without the World File:

What should I Get

This is what I get with the World File:

What I Get with World File

8
  • Could you clarify what you mean with pixelized GeoJSON? It is a vector format and does not have pixels so I guess you see some other artifacts. Link to full resolution source image and good and bad result would help.
    – user30184
    Commented Jul 8, 2015 at 9:47
  • I added some pictures of the GeoJSON so that you can understand more clearly what I mean...
    – bkbilly
    Commented Jul 8, 2015 at 10:47
  • Really odd. Could we get the source png as well? What GDAL version do you have? The pixel size of the source image seems to be 3.8 cm. Do you think it is OK?
    – user30184
    Commented Jul 8, 2015 at 10:49
  • I have GDAL 1.11.1 postimg.org/image/7nunun7nz Yes, the pixel size is correct!
    – bkbilly
    Commented Jul 8, 2015 at 10:56
  • Unfortunately I could not make the GDAL python utilities work with the computer I have on my hands. Let's hope someone else can help you.
    – user30184
    Commented Jul 8, 2015 at 11:40

1 Answer 1

2

Thanks to user30184, I managed to solve the problem.

It seems that the version of the GDAL I had installed, which was 1.11.1, had a problem with the function gdal_polygonize.py. I installed the newest version of GDAL (2.0.0) and it works perfectly!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.