[postgis-users] pgsql2shp syntax - sentence construction
elvin.pimentel at gmail.com
Mon Jun 2 19:01:24 PDT 2008
>If you are not changing the geometry, you can do all your attribute
>updates as simple SQL updates
Some changes are just name corrections, but I need also update the maps with
new streets and roads, and that is the most important updates that needs to
be done, since our maps are couple of years old and there are many new
streets to add and that's why Im asking if the best way is to dump postgres
to shape, update and then convert it again. What do you think is the best
way to achive this updating process?
P Kishor-3 wrote:
> On 6/2/08, SenTnel <elvin.pimentel at gmail.com> wrote:
>> Thanks Stephen!
>> I must admit that Im not good at this, but Im determined to mantain my
>> city's database correcting names and roads classifications, etc., that's
>> I need to take the postgres data and convert it to shapefile, then
>> things with arcmap, then drop the old postgres data and then re-convert
>> updated shapefile to postgres, is this the way you would do it?
> If you are not changing the geometry, you can do all your attribute
> updates as simple SQL updates (see below).
>> I have one more question about this updating, and this is a "select"
>> question, (I'll remind you that Im an ignorant in this matters) would
>> please construct an sql sentence to achive this:
>> In mydatabase, myschema, mytable there's a "street" column, where the
>> names are, let's say I want to correct a misspeled name, for example,
>> Washington", and want to correct it to "George Washington", how do you
>> the select?
> UPDATE mytable
> SET street = 'George Washington'
> WHERE street = 'Geoge Washington'
> Note the single quotes to delimit the text strings.
> You might do well do spend some time looking a few basic SQL tutorials
> before launching ahead. You will get more mileage from the tutorials
> than from asking these simple questions on list.
>> Thanks again!
>> Stephen Woodbridge wrote:
>> > SenTnel wrote:
>> >> Hi! Im working with postgres and geoserver but im just not good at
>> >> statements, none the less in construction sentences in postgres, and
>> >> would
>> >> like to create a shapefile from a table in postgres and don't want to
>> >> make a
>> >> costly mistake, so if you help me achieve this using pgsql2shp:
>> >> database name: mydatabase
>> >> schema: myschema
>> >> table: mytable
>> >> shapefile to be created: updatedshp
>> >> database user: postgres
>> >> password: any
>> >> can you help me with the syntax to achieve the shapefile containing
>> >> of
>> >> the data (and geom) in such table?
>> >> Thanks !
>> > SenTel,
>> > pgsql2shp is not a SQL statement it is a command line tool:
>> > woodbri at carto:~$ pgsql2shp
>> > RCSID: $Id: pgsql2shp.c,v 1.82 2006/01/16 10:42:57 strk Exp $
>> > USAGE: pgsql2shp [<options>] <database> [<schema>.]<table>
>> > pgsql2shp [<options>] <database> <query>
>> > OPTIONS:
>> > -f <filename> Use this option to specify the name of the file
>> > to create.
>> > -h <host> Allows you to specify connection to a database on a
>> > machine other than the default.
>> > -p <port> Allows you to specify a database port other than the
>> > default.
>> > -P <password> Connect to the database with the specified password.
>> > -u <user> Connect to the database as the specified user.
>> > -g <geometry_column> Specify the geometry column to be exported.
>> > -b Use a binary cursor.
>> > -r Raw mode. Do not assume table has been created by
>> > the loader. This would not unescape attribute names
>> > and will not skip the 'gid' attribute.
>> > -k Keep postgresql identifiers case.
>> > So you might use it like:
>> >> pgsql2shp -f updatedshp.shp -h localhost -u postgres mydatabase
>> >> myschema.mytable
>> > Have fun,
>> > -Steve W
>> > _______________________________________________
>> > postgis-users mailing list
>> > postgis-users at postgis.refractions.net
>> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>> View this message in context:
>> Sent from the PostGIS - User mailing list archive at Nabble.com.
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
> postgis-users mailing list
> postgis-users at postgis.refractions.net
View this message in context: http://www.nabble.com/pgsql2shp-syntax---sentence-construction-tp17613265p17614606.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
More information about the postgis-users