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

Can't Produce Segmentation Data #118

Closed
skarakulak opened this issue Nov 8, 2018 · 14 comments
Closed

Can't Produce Segmentation Data #118

skarakulak opened this issue Nov 8, 2018 · 14 comments
Labels
bug Something isn't working

Comments

@skarakulak
Copy link

Hi,

I was trying to produce a segmentation data on an area in Philippines with the configuration below. label-maker download command creates the mbtiles and geojson files. However when I try to produce the labels and images, label-maker just creates empty folders. Where do I do wrong? I have installed mbviewer and made sure that the region that I downloaded contains labels.

{
  "country": "philippines",
  "bounding_box": [121.464843728242,18.312810843256784,121.50878904073498,18.354525525951416],
  "zoom": 12,
  "classes": [
    { "name": "Landuse", "filter": ["has", "landuse"] },
    { "name": "Roads", "filter": ["has", "highway"] },
    { "name": "Building", "filter": ["has", "building"] }
  ],
"imagery": "http://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=pk.eyJ1Ijoic2thcmFrdWxhayIsImEiOiJjam54Z3YwaDYwMGhkM3FwY3BmeG1lZHd5In0.dAFYUvWpcw7katdB9xeBSg",
  "background_ratio": 1,
  "ml_type": "segmentation"
}

@drewbo
Copy link
Contributor

drewbo commented Nov 9, 2018

@skarakulak just checked it out and I can confirm that I'm seeing the same issue. I'll mess around with this for a while and update soon. Thanks for the bug report!

@drewbo drewbo added the bug Something isn't working label Nov 9, 2018
@drewbo
Copy link
Contributor

drewbo commented Nov 9, 2018

@skarakulak Looks like there is a TopologicalError thrown by one of the geometries and it silently causes the tile processing section to fail. I'll add some handling for that to fix this

@skarakulak
Copy link
Author

Thanks a lot for the quick response, much appreciated

drewbo added a commit that referenced this issue Nov 9, 2018
@skarakulak
Copy link
Author

I have tried with the latest code but still getting no labels:

serkan@serkan-HP-ubuntu:~/temp_geo$ label-maker labels
Determining labels for each tile
TopologyException: Input geom 0 is invalid: Self-intersection at or near point 9 247 at 9 247
---
Landuse: 0 tiles
Roads: 0 tiles
Building: 0 tiles
Total tiles: 4
Writing out labels to data/labels.npz
serkan@serkan-HP-ubuntu:~/temp_geo$ label-maker images
Downloading 0 tiles to data/tiles

@drewbo
Copy link
Contributor

drewbo commented Nov 9, 2018

@skarakulak it still isn't merged in yet. If you want to try it out now, you can install directly from the repo (pip install -e .) on the branch bug/118-skip-bad-geometries. Otherwise, we'll have a new release early next week

wronk added a commit that referenced this issue Nov 12, 2018
@NickElixir
Copy link

I got same problem.

TopologyException: Input geom 0 is invalid: Self-intersection at or near point 226 179 at 226 179

Analogical errors appear with other bounding boxes.
Is this bug or my mistake?

@NickElixir
Copy link

I tried the example from devseed.com and got same:
TopologyException: Input geom 0 is invalid: Self-intersection at or near point 216 84 at 216 84 The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at 0x7fe07347d898> skipping
What's the problem?

@Geoyi
Copy link
Contributor

Geoyi commented Jun 13, 2019

@NickElixir, check your (multi)polygon/geometry, when it was created, some bow-tie/intersect was accidentally created. Check this - How to fix invalid polygon with self-intersection - Python .

@NickElixir
Copy link

NickElixir commented Jun 13, 2019

@Geoyi, I don't understand what I should do. This is my bounding box: [1.09725, 6.05520, 1.34582, 6.30915] for togo

@skarakulak
Copy link
Author

skarakulak commented Jun 13, 2019 via email

@NickElixir
Copy link

@skarakulak I use Colab for downloading images for segmentation. How I can install your fork in Colab?

@drewbo
Copy link
Contributor

drewbo commented Jun 13, 2019

@NickElixir @skarakulak @Geoyi the problematic geometries sometimes come directly from OSM or when they get chopped up by our tiling. It will show the warning but skips the geometry and should continue from there.

@NickElixir are you still getting results after seeing that warning?

@NickElixir
Copy link

NickElixir commented Jun 13, 2019

@drewbo, I got some but less now. Does this error mean that I skip tags?
I see that dataset is not full and not balanced.
The problem is that probability of error per tag is not random.

@drewbo
Copy link
Contributor

drewbo commented Jun 14, 2019

@NickElixir it's possible to fix the underlying geometries first then load as a GeoJSON but that's a bit of a pain. When you say that you're getting "less now" (I assume labels), less than when?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants