views:

55

answers:

2

I'm working on a Debian machine with postgresql installed. I need to find shp2pgsql (a utility that converts shapefiles into SQL, as the name suggests).

I've seem suggestions that it's located in the bin directory of postgresql, however I don't know where to find this. I can't locate shp2pgsql through a simple find (probably much too simple, since my Unix skills are not that good):

$ find ~ -name 'shp2pgsql' -print
$ 

Any suggestions?

Thanks - apologies for the basic question!

A: 

The first argument to find is the path from which to search. ~ is your home directory. Your command searches shp2pgsql from your home directory, not in the bin directory. With find, user command find /usr/lib/postgresql/ -name shp2pgsql.

If your system has locate installed, you could also locate shp2pgsql.

jmz
A: 

I'm pretty sure you need PostGIS installed - its part of that package. You can install it from that site, or its likely that Debian's package manager even has it. Where it ends up depends on package builder.

Actually finding it, if its not in your PATH after you install PostGIS, is probably easiest done through locate shp2pgsql although you may need to updatedb first.

Additionally, you can find your Postgres relevant directories by running pg_config .

rfusca