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

‘read’ is not a member of ‘Osmium::Input’ #7

Open
Rudloff opened this issue Aug 17, 2014 · 4 comments
Open

‘read’ is not a member of ‘Osmium::Input’ #7

Rudloff opened this issue Aug 17, 2014 · 4 comments

Comments

@Rudloff
Copy link

Rudloff commented Aug 17, 2014

I get this error when I try to compile:

g++ -ggdb -Wall -Wredundant-decls -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c osm2shp.cc -o osm2shp.o
osm2shp.cc: In function 'int main(int, char**)':
osm2shp.cc:18:17: error: 'read' is not a member of 'Osmium::Input'
osm2shp.cc:18:17: note: suggested alternative:
In file included from /usr/include/boost/config/stdlib/libstdcpp3.hpp:76:0,
                 from /usr/include/boost/config.hpp:44,
                 from /usr/include/boost/tr1/detail/config.hpp:164,
                 from /usr/include/boost/tr1/memory.hpp:8,
                 from /usr/include/osmium/osm/object.hpp:33,
                 from /usr/include/osmium/osm.hpp:38,
                 from /usr/include/osmium.hpp:109,
                 from osm2shp.cc:5:
/usr/include/unistd.h:357:16: note:   'read'
make: *** [osm2shp.o] Error 1
@eren
Copy link

eren commented Feb 28, 2015

I get the same error. It seems that the project is no longer maintained. Should we try to find alternatives for converting osm data to shapefile?

@minad
Copy link
Owner

minad commented Feb 28, 2015

I don't know if there are other projects which do that? I think there is a lot of movement going in the osm community. Maybe I could get this running again if many people are interested.

@eren
Copy link

eren commented Feb 28, 2015

Currently the only seamless and working solution is to use postgresql. I've tried postgresql and confirm that it's working.

1- Install osm2pgsql (it's present in ubuntu repositories and correctly packaged, which installs required dependencies as well)
2- Create postgresql database with postgis extension
3- Use osm2pgsql to insert osm data into postgresql
4- Use pgsql2shp tool to dump postgres databases.

In my case, osm2pgsql created the following tables:

 public | planet_osm_line    | table | gis
 public | planet_osm_point   | table | gis
 public | planet_osm_polygon | table | gis
 public | planet_osm_roads   | table | gis

I then used the following one-liner to dump those tables:

for i in {line,point,polygon,roads}; do pgsql2shp -f output$i -h localhost -u gis -P PASSWORD DATABASE planet_osm_$i; done

The process is a bit long. It would be good to have a tool that can operate on file. Rather than importing to database, and exporting it, operating solely on file is preferred. That's your choice, sir. If you have time, it would be awesome.

I can help package the app for ubuntu/debian when it's ready.

Btw, for those people who are visiting this page, I found pre-built shape data here. However, this page only provides country-level. If you want to extract a city or a specific region other than a whole country, the region should be downloaded from overpass api, and converted to shp.

@abdultz
Copy link

abdultz commented May 19, 2015

You could just refer to the old Osmium instead of installing the new Osmium libraries
https://github.com/joto/osmium
Put the include files (and osmium.hpp) from the above in /usr/include
$> make
then should succeed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants