[osmosis-dev] extracting nodes and ways

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[osmosis-dev] extracting nodes and ways

Bjenk Ellefsen
Hello, 

I have a weird result and I am trying to figure this out.

I am trying to use this command to extract ways and nodes of buildings in one command:

osmosis --rx city.osm --tf accept-ways 'building=*' --tf accept-nodes 'buildings=*' --tf reject-relations --used-node --wx CityBuild.osm

However, whan I do that, I lose the polygons if I then try to convert to geojson. If I use only --tf accept-ways, I get the polygons. 

Now, If I run the same command with just ways, then with just nodes and merge both OSM before converting, I get both no problems.

Does this mean it is not possible to extract both in one command? This would so much simpler if it worked. Any ideas?

Thanks!

_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev
Reply | Threaded
Open this post in threaded view
|

Re: [osmosis-dev] extracting nodes and ways

Nathan Smith

I’m new at this, but aren’t the relations what translate the ways into polygons?  Have you tried your original command with --tf accept-relations?  

 

I’m also curious if the --used node command complicates the extraction of polygons…?

 

From: Bjenk Ellefsen [mailto:[hidden email]]
Sent: Friday, January 06, 2017 12:10 PM
To: [hidden email]
Subject: [osmosis-dev] extracting nodes and ways

 

Hello, 

 

I have a weird result and I am trying to figure this out.

 

I am trying to use this command to extract ways and nodes of buildings in one command:

 

osmosis --rx city.osm --tf accept-ways 'building=*' --tf accept-nodes 'buildings=*' --tf reject-relations --used-node --wx CityBuild.osm

 

However, whan I do that, I lose the polygons if I then try to convert to geojson. If I use only --tf accept-ways, I get the polygons. 

 

Now, If I run the same command with just ways, then with just nodes and merge both OSM before converting, I get both no problems.

 

Does this mean it is not possible to extract both in one command? This would so much simpler if it worked. Any ideas?

 

Thanks!


_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev
Reply | Threaded
Open this post in threaded view
|

Re: [osmosis-dev] extracting nodes and ways

Bjenk Ellefsen
Hello Nathan, 

You are correct and I have modified my script. It looks like it really has to be three commands: one for ways, the other for nodes and the last one to merge.

As you pointed out, --used-node shouldn't be with the --tf accept-nodes command. 

After modifying everything correctly, my problem was not actually there but it happens with the merge.

So the first file is extracting the ways, the second the nodes. Both are ok but when I merge them, I no longer have the correct number of ways or nodes. I get a far too high number.

osmosis --rx city.osm --tf accept-ways 'building=*' --tf reject-relations --used-node --wx CityBuildW.osm

osmosis --rx city.osm --tf accept-nodes 'building=*' --tf reject-relations --wx CityBuildN.osm

osmosis --rx CityBuildW.osm --rx CityBuildN.osm --merge --wx CityBuildings.osm

I dont know why the merge is giving me that.

On Fri, Jan 6, 2017 at 3:07 PM, Nathan Smith <[hidden email]> wrote:

I’m new at this, but aren’t the relations what translate the ways into polygons?  Have you tried your original command with --tf accept-relations?  

 

I’m also curious if the --used node command complicates the extraction of polygons…?

 

From: Bjenk Ellefsen [mailto:[hidden email]]
Sent: Friday, January 06, 2017 12:10 PM
To: [hidden email]
Subject: [osmosis-dev] extracting nodes and ways

 

Hello, 

 

I have a weird result and I am trying to figure this out.

 

I am trying to use this command to extract ways and nodes of buildings in one command:

 

osmosis --rx city.osm --tf accept-ways 'building=*' --tf accept-nodes 'buildings=*' --tf reject-relations --used-node --wx CityBuild.osm

 

However, whan I do that, I lose the polygons if I then try to convert to geojson. If I use only --tf accept-ways, I get the polygons. 

 

Now, If I run the same command with just ways, then with just nodes and merge both OSM before converting, I get both no problems.

 

Does this mean it is not possible to extract both in one command? This would so much simpler if it worked. Any ideas?

 

Thanks!


_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev



_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev
Reply | Threaded
Open this post in threaded view
|

Re: [osmosis-dev] extracting nodes and ways

Bjenk Ellefsen
In reply to this post by Nathan Smith
Nathan, I just read your message again and I tried removing reject relations and I get the same results. The two initial files are fine but when merged, the number of ways and nodes is way off.

On Fri, Jan 6, 2017 at 3:07 PM, Nathan Smith <[hidden email]> wrote:

I’m new at this, but aren’t the relations what translate the ways into polygons?  Have you tried your original command with --tf accept-relations?  

 

I’m also curious if the --used node command complicates the extraction of polygons…?

 

From: Bjenk Ellefsen [mailto:[hidden email]]
Sent: Friday, January 06, 2017 12:10 PM
To: [hidden email]
Subject: [osmosis-dev] extracting nodes and ways

 

Hello, 

 

I have a weird result and I am trying to figure this out.

 

I am trying to use this command to extract ways and nodes of buildings in one command:

 

osmosis --rx city.osm --tf accept-ways 'building=*' --tf accept-nodes 'buildings=*' --tf reject-relations --used-node --wx CityBuild.osm

 

However, whan I do that, I lose the polygons if I then try to convert to geojson. If I use only --tf accept-ways, I get the polygons. 

 

Now, If I run the same command with just ways, then with just nodes and merge both OSM before converting, I get both no problems.

 

Does this mean it is not possible to extract both in one command? This would so much simpler if it worked. Any ideas?

 

Thanks!


_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev



_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev