How to optimize the housenumbers table

53 views
Skip to first unread message

sylade76

unread,
Jun 17, 2019, 4:41:41 PM6/17/19
to imposm
Hello,
I use your example mapping and I want to optimize to house numbers table by removing the empty and duplicate names.  

- Removing the empty names:
I tried use the reject filters but it isn't working:

tables:
  amenities:
    columns:
    - name: osm_id
      type: id
    - name: geometry
      type: geometry
    - key: name
      name: name
      type: string
    - name: type
      type: mapping_value
    filters:
      reject:
        name: ['']
    mapping:
      amenity:
      - bar

How to add a criterion to avoid the empty name in the housenumbers table?

- Removing the duplicate names 
In your your exemple mapping:

  landusages_gen0:
    source: landusages_gen1
    sql_filter: ST_Area(geometry)>500000.000000
    tolerance: 200.0

Is it possible to use a similar criterion to remove the identical names with the very near goemetries (< 1 meter for example) in the housenumbers table?

Thank you.

SyLaDe

Imre Samu

unread,
Jun 17, 2019, 5:29:32 PM6/17/19
to imp...@googlegroups.com
Warm welcome in the imposm community!

#1.  Removing the empty names:

```
    filters:
      reject:
        name: ['']
```
As I know - the filtering and the mapping part run - before the columns mapping part. 
So you only can filter the real OSM keys!
But because the OSM does not store the empty osm values ...  You can't filter it.

So my suggestion - use the opposite.
    filters:
      require:
        name: [__any__]


Example:
<node id="6403982685" visible="true" version="2" changeset="69613487" timestamp="2019-04-26T19:52:09Z" lat="47.5021953" lon="19.0518774">
<tag k="addr:city" v="Budapest"/>
<tag k="addr:housenumber" v="25"/>
<tag k="addr:postcode" v="1051"/>
<tag k="addr:street" v="Sas utca"/>
<tag k="amenity" v="bar"/>
<tag k="name:en" v="Hedon Taproom"/>
<tag k="opening_hours" v="Th-Sa 12:00-00:00; Su-We 15:00-23:00"/>
</node>


in this case no name=''   key-value - so you can't reject with your example.


#2. Removing the duplicate names

AS I know - the imposm3 does not support this.
You need to create some PostGIS postprocessing - dropping the duplicate names.
For example you can identify duplicate records with st_dwithin ( https://gis.stackexchange.com/questions/315157/using-st-dwithin-to-see-duplicates )   and in the second step drop ..
or maybe you can find better PostGIS code.


Best,
 Imre


 

--
--
_______________________________________________
Imposm mailing list
imp...@googlegroups.com
http://groups.google.com/group/imposm

---
You received this message because you are subscribed to the Google Groups "imposm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imposm+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/imposm/5744fb30-4955-4058-a086-b14cb03177ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sylade76

unread,
Jun 17, 2019, 6:51:59 PM6/17/19
to imposm
Thank you for your response.

I just seen one line in my table

"name": (empty)
"addr:housenumber": 40
"addr:street": Rue des Plantes
"addr:postcode": 75014
"addr:city": Paris

I compared this line with the the nomination base and I found:

OpenStreetMap_Nominatim__Search.png

On in this screenshot, I see that the name is also empty.

In reality, it is the restaurant "Gourmet d'Alésia".


Are they some errors in the OMS tables?



For the duplicate names, I will post an other topic.

SyLaDe.

Imre Samu

unread,
Jun 17, 2019, 8:03:35 PM6/17/19
to imp...@googlegroups.com
> In reality, it is the restaurant "Gourmet d'Alésia".
> Are they some errors in the OMS tables?

The OSM is not perfect.  it is just a community database - so If you find a problem you can fix it yourself.    just register as an osm user - and click edit ->  and fix  :)
or you can ask help from the local OSM community.

Best,
Imre


--
--
_______________________________________________
Imposm mailing list
imp...@googlegroups.com
http://groups.google.com/group/imposm

---
You received this message because you are subscribed to the Google Groups "imposm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imposm+un...@googlegroups.com.

sylade76

unread,
Jun 19, 2019, 12:49:25 PM6/19/19
to imposm
Hi,

I would to add a column "import date" in the housenumbers table. This column allows the post processing to analyze only the new lines imported by imposm instead of the the all lines.
It is possible to do it with mapping.yml?

Thank

To unsubscribe from this group and stop receiving emails from it, send an email to imp...@googlegroups.com.

Imre Samu

unread,
Jun 21, 2019, 9:59:34 AM6/21/19
to imp...@googlegroups.com
>I would to add a column "import date" in the housenumbers table. 
>This column allows the post processing to analyze only the new lines imported by imposm instead of the the all lines.

As I know - no direct support  yet;
(in theoretically)  you can do with some postgresql magic ( trigger, default column )
or with a minimal Go knowledge - you can add a special mapping type (  " mapping/fieldtype_current_datetimeutc.go"  https://github.com/ImreSamu/imposm3_fieldtypes ( not working example ) ) 

Imre




To unsubscribe from this group and stop receiving emails from it, send an email to imposm+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/imposm/ec86b516-dc58-4ea4-8fc0-edaba2ab1803%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages