omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
719 stars 157 forks source link

Very small areas when importing in ESPG:4326 #102

Closed ldng closed 8 years ago

ldng commented 8 years ago

I might be missing something but it seems there is a problem when importing in ESPG:4326. gen1 and gen0 tables are empty for osm_landusages and osm_waterareas are empty. It seems to be because geometries areas are too small.

Available for more info if needed.

select ST_Area(geometry) from osm_landusages limit 25;

    0.000141659657411596
    0.000238436680460641
    5.12621326097827e-06
    2.18673888475979e-07
    1.23640265177801e-05
    4.84754194978097e-05
    5.32043692645324e-05
    4.32980968048628e-05
    0.00354810707771226
    0.0020066573460534
    0.000695352727435388
    0.00104253813145195
    0.000501286638090628
    0.000686526927971164
    0.000265206553353398
    0.00199897449926106
    0.000732953682048933
    0.000354723759697833
    0.000874956971753902
    0.000449316792706722
    0.000735079231886424
    0.000121516306838965
    0.000831788110781543
    0.000267070822256388
    0.000196064267463536

The mapping :

      "generalized_tables": {
        "waterareas_gen1": {
          "source": "waterareas",
          "sql_filter": "ST_Area(geometry)>50000.000000",
          "tolerance": 50.0
        },
        "waterareas_gen0": {
          "source": "waterareas_gen1",
          "sql_filter": "ST_Area(geometry)>500000.000000",
          "tolerance": 200.0
        },
        "roads_gen0": {
          "source": "roads_gen1",
          "sql_filter": null,
          "tolerance": 200.0
        },
        "roads_gen1": {
          "source": "roads",
          "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link') OR class IN('railway')",
          "tolerance": 50.0
        },
        "waterways_gen0": {
          "source": "waterways_gen1",
          "sql_filter": null,
          "tolerance": 200
        },
        "waterways_gen1": {
          "source": "waterways",
          "sql_filter": null,
          "tolerance": 50.0
        },
        "landusages_gen1": {
          "source": "landusages",
          "sql_filter": "ST_Area(geometry)>10000.000000",
          "tolerance": 50.0
        },
        "landusages_gen0": {
          "source": "landusages_gen1",
          "sql_filter": "ST_Area(geometry)>100000.000000",
          "tolerance": 200.0
        }
      },
ImreSamu commented 8 years ago

The ST_Area() results are in SRID units

And :

So you have to convert/modify the sql_filter: and the tolerance: parameters to your projections.

see more :

ldng commented 8 years ago

Hum, did not know that. I did not even think of checking area unit and assumed it was meters. My bad. Closing this non-issue. Thanks.