[postgis-users] postgis-users Digest, Vol 134, Issue 4

Langen Mallya cutlan at gmail.com
Sat Apr 6 12:06:59 PDT 2013


google & binhs maps are for ameteures. for full GIS PostGIS is ok
On Apr 6, 2013 7:00 PM, <postgis-users-request at lists.osgeo.org> wrote:

> Send postgis-users mailing list submissions to
>         postgis-users at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> or, via email, send a message with subject or body 'help' to
>         postgis-users-request at lists.osgeo.org
>
> You can reach the person managing the list at
>         postgis-users-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of postgis-users digest..."
>
>
> Today's Topics:
>
>    1. postgis v. google (zach cruise)
>    2. Re: postgis v. google (pcreso at pcreso.com)
>    3. Re: postgis v. google (Martin Feuchtwanger)
>    4. Re: postgis v. google (Martin Feuchtwanger)
>    5. unique id in QGIS/PostGIS (Margie Roswell)
>    6. Re: unique id in QGIS/PostGIS (Paolo Corti)
>    7. Re: How to perform st_PixelAsPolygon(rast, geom) ?
>       (Hugues Fran?ois)
>    8. Re: unique id in QGIS/PostGIS (Richard Greenwood)
>    9. Re: unique id in QGIS/PostGIS (Margie Roswell)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 5 Apr 2013 18:35:15 -0400
> From: zach cruise <zachc1980 at gmail.com>
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Subject: [postgis-users] postgis v. google
> Message-ID:
>         <
> CAL8icXyEdZ0Db0xgNYoAkWCbd+sN_KHyGwknsPQQJN4HcLAOfQ at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> when would using just google maps make more sense than using something
> with postgis?
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 5 Apr 2013 16:04:11 -0700 (PDT)
> From: pcreso at pcreso.com
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Subject: Re: [postgis-users] postgis v. google
> Message-ID:
>         <1365203051.79736.YahooMailClassic at web122001.mail.ne1.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Very briefly...
>
> When you want to manage spatial data, especially large volumes,or analyze
> them, or do polar maps, or use projections to display data in a more
> correct cartographic or spatial way...
>
> Postgis plus a mapserver (mapserver/geoserver/deegree/etc) plus a web
> mapping client (Openlayers/leaflet/etc) gives you a more complex & more
> powerful suite than Google. If you need that power & complexity.
>
> Google (or Bing) gives you a rich global context map dataset to display
> your data on top of, that you need to provide for yourself otherwise.
>
> There is a place for both... if I was to employ a competent statistical
> modeller, I would not choose someone who's tool of choice was a
> spreadsheet. Similarly, a web mapping specialist or cartographer who's only
> experience was with Google... so is a simple spreadsheet approach adequate
> for your needs or not?
>
> Cheers,
>
> ? Brent Wood
> --- On Sat, 4/6/13, zach cruise <zachc1980 at gmail.com> wrote:
>
> From: zach cruise <zachc1980 at gmail.com>
> Subject: [postgis-users] postgis v. google
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Date: Saturday, April 6, 2013, 11:35 AM
>
> when would using just google maps make more sense than using something
> with postgis?
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/postgis-users/attachments/20130405/6b93f5f7/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Fri, 05 Apr 2013 17:33:40 -0700
> From: Martin Feuchtwanger <feumar at shaw.ca>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Cc: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Subject: Re: [postgis-users] postgis v. google
> Message-ID: <515F6D64.3080609 at shaw.ca>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>  From my point-of-view, it's a rather odd question; i see them as
> complementing one another nicely.
> I'm working on a project that involves a large spatial database, which
> i'm storing in postgis, and google earth, which i'm using as the
> display/view tool. Postgis easily outputs kml for google earth/maps.
>
> Martin Feuchtwanger  feumar at shaw.ca  604-254-0361
> http://members.shaw.ca/geomatics.developer
>
> On 05/04/2013 3:35 PM, zach cruise wrote:
>
> > when would using just google maps make more sense than using something
> > with postgis?
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 05 Apr 2013 17:33:40 -0700
> From: Martin Feuchtwanger <feumar at shaw.ca>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Cc: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Subject: Re: [postgis-users] postgis v. google
> Message-ID: <515F6D64.3080609 at shaw.ca>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>  From my point-of-view, it's a rather odd question; i see them as
> complementing one another nicely.
> I'm working on a project that involves a large spatial database, which
> i'm storing in postgis, and google earth, which i'm using as the
> display/view tool. Postgis easily outputs kml for google earth/maps.
>
> Martin Feuchtwanger  feumar at shaw.ca  604-254-0361
> http://members.shaw.ca/geomatics.developer
>
> On 05/04/2013 3:35 PM, zach cruise wrote:
>
> > when would using just google maps make more sense than using something
> > with postgis?
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 5
> Date: Sat, 6 Apr 2013 04:18:59 -0400
> From: Margie Roswell <mroswell at gmail.com>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Subject: [postgis-users] unique id in QGIS/PostGIS
> Message-ID:
>         <
> CAPAc6WEf0RfHPB7tNX2LnsXf2u6KNwa9ZR9qrJo4HeQ2HV5kXg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I've been googling up a storm, now that I've got a local postgis database
> with QGIS. But still haven't figured out how to display a newly created
> table.
>
> The query I used to create the table:
> CREATE TABLE smaller_leg_final AS
> SELECT ST_Buffer(geom,-500) AS geom, legislative_final.district
> FROM legislative_final
> WHERE area > 30;
>
> I then discovered that I needed a unique ID, and did the following:
> ALTER TABLE smaller_leg_final ADD COLUMN id serial not null;
>
> This successfully populated the ID field with unique integers.
>
> However when I go into QGIS, the Primary Key column offers no options. when
> I click into it, it just asks me to choose an SRID, which I believe I've
> already done. The table loads, but nothing displays.
>
> I honestly feel a bit like a toddler given ice skates and placed on an icy
> rink. I'm toddling my way around, falling, getting back up, and then
> looking up and asking: why did I fall?
>
> Once upon a time I was at the true cutting edge of GIS... I purchased
> MapInfo versions 1.1, and upgraded from there for many years. Moving into
> QGIS/Posgres/postGIS now, and well on the path to success, but .... not...
> quite... there.
>
> Are there any QGIS users here who can help me to display my new table?
>
> Do I need a different postgres statement? Is there a different field name
> expected? Maybe my query generated invalid shapes... But still, the geom
> field is displaying in the "Add PostGIS layers "Geometry column", but the
> Primary key column option doesn't allow me to select my 'id' field.
>
> Insight welcome.
>
>
>
>
> --
> http://FarmBillPrimer.org
> http://www.BaltimoreUrbanAg.org (Please send events; This site is hungry.)
> http://www.ExcellentNutrition.org
> http://www.packtpub.com/drupal-5-views-recipes/book
>
>
> On Thu, Apr 4, 2013 at 11:21 AM, Lelo - Luiz Rog?rio De Pieri <
> lelo.pieri at gmail.com> wrote:
>
> > Hi all,
> >
> > I'm having a problem to execute a pgsql2shp command using java.
> >
> > My OS is Ubuntu and it's frequently I use to generate shp files using
> > pgsql2shp, but now I want to do it through java.
> >
> > The follow command works fine on terminal
> > pgsql2shp -f pontos_05600202_teste -h myhost -u myuser -P mypasswd -g
> > coordinates my_database "SELECT * from points where id_uploaded_file =
> > 37995";
> >
> > Now I'm trying to execute the follow code:
> >
> > ProcessBuilder pb = new ProcessBuilder("pgsql2shp", "-f
> > pontos_05600202_teste", "-h myhost", "-u myuser", "-P mypasswd", "-g
> > coordinates", "my_database", "SELECT coordinates, date from points where
> > id_uploaded_file = 37995");
> >
> > Process proc;
> > proc = pb.start();
> > InputStream stdin = proc.getInputStream();
> > InputStreamReader isr = new InputStreamReader(stdin);
> > BufferedReader br = new BufferedReader(isr);
> >
> > String line = null;
> > System.out.println("<OUTPUT>");
> >
> > while ((line = br.readLine()) != null)
> >     System.out.println(line);
> >
> > System.out.println("</OUTPUT>");
> > int exitVal = proc.waitFor();
> > System.out.println("Process exitValue: " + exitVal);
> >
> >
> > And the result is:
> >
> > <OUTPUT>
> > Preparing table for user query... Done.
> > Initializing...  coordinates: no such attribute in table
> > __pgsql2shp14493_tmp_table
> > </OUTPUT>
> >
> > Does anybody as any idea about it?
> >
> > Thank you for all
> >
> > Best regards
> > --
> > Rog?rio De Pieri  (Lelo)
> > SCJP 5
> > Buscando melhorar a cada dia
> > ?udio, Hardware & Software
> > www.twitter.com/lelopieri
> > blogdolelo.wordpress.com
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/postgis-users/attachments/20130406/b5cf6410/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 6
> Date: Sat, 6 Apr 2013 11:03:10 +0200
> From: Paolo Corti <pcorti at gmail.com>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Subject: Re: [postgis-users] unique id in QGIS/PostGIS
> Message-ID:
>         <
> CAHXrU-+d2LzvC4t76q+wK1wL86CxvmNPMpW8aVdpOuzY9x-9qA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Apr 6, 2013 at 10:18 AM, Margie Roswell <mroswell at gmail.com>
> wrote:
> >
> > The query I used to create the table:
> > CREATE TABLE smaller_leg_final AS
> > SELECT ST_Buffer(geom,-500) AS geom, legislative_final.district
> > FROM legislative_final
> > WHERE area > 30;
> >
> > I then discovered that I needed a unique ID, and did the following:
> > ALTER TABLE smaller_leg_final ADD COLUMN id serial not null;
> >
> > This successfully populated the ID field with unique integers.
> >
> > However when I go into QGIS, the Primary Key column offers no options.
> when
> > I click into it, it just asks me to choose an SRID, which I believe I've
> > already done. The table loads, but nothing displays.
> >
>
> Which version of PostGIS are you using?
> Could you send the DDL CREATE TABLE syntax?
>
> You can get it like this:
>
> pg_dump -t tablename --schema-only
>
> or copy and paste it from the pgAdmin SQL table pane
>
> I have the suspect, thought, that you are using PostGIS < 2.0: in that
> case you explicitely need to record the metadata in geometry_columns
> using AddGeometryColumn
>
> regards
> p
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
>
>
> ------------------------------
>
> Message: 7
> Date: Sat, 6 Apr 2013 14:11:23 +0200
> From: Hugues Fran?ois <hugues.francois at irstea.fr>
> To: "PostGIS Users Discussion" <postgis-users at lists.osgeo.org>
> Subject: Re: [postgis-users] How to perform st_PixelAsPolygon(rast,
>         geom) ?
> Message-ID:
>         <
> 3CB901080554B04881D30F111F62D930028EEFE6 at nadia.grenoble.cemagref.fr>
> Content-Type: text/plain;       charset="iso-8859-1"
>
> Thank you very much Pierre ! That's exactly what I was looking for. Sorry
> I didn't find the st_worldtorastercoord functions which do exactly what I
> need (maybe it should be a good idea to add a reference in the pixel
> accessors et setter functions -in "see also" -  since theses function work
> at the pixel level).
>
> Hugues.
>
> -----Message d'origine-----
> De?: postgis-users-bounces at lists.osgeo.org [mailto:
> postgis-users-bounces at lists.osgeo.org] De la part de Pierre Racine
> Envoy??: vendredi 5 avril 2013 18:12
> ??: PostGIS Users Discussion
> Objet?: Re: [postgis-users] How to perform st_PixelAsPolygon(rast, geom) ?
>
> You can do:
>
> SELECT ST_PixelAsPolygon(rast, ST_WorldToRasterCoordX(rast, ST_X(geom)),
> ST_WorldToRasterCoordY(rast, ST_Y(geom))) geom FROM yourrast, yourpoints
> WHERE ST_Intersects(rast, geom)
>
> Note that PixelAsPolygon has no "s".
>
> You will get the vectorization of every pixels having a point inside. Up
> to you to deal with duplicates.
>
> Pierre
>
> > -----Original Message-----
> > From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> > bounces at lists.osgeo.org] On Behalf Of Hugues Fran?ois
> > Sent: Friday, April 05, 2013 6:51 AM
> > To: postgis-users at lists.osgeo.org
> > Subject: [postgis-users] How to perform st_PixelAsPolygon(rast, geom) ?
> >
> > Hello,
> >
> >
> >
> > I need to work with a dem raster at the pixel scale but there are few
> > functions to access them. Maybe I forgot something but, if we can have
> > a value crossing a point with raster using st_value, we can't access
> > the pixel geometry directly from a point.
> >
> >
> >
> > The only way I found was first to use St_PixelAsPolygons to access
> > pixel geometry (for relevant tiles) and then intersects resulting
> > geometries with original points but this method costs very much.
> >
> >
> >
> > Anyone have an idea to increase performances ?
> >
> >
> >
> > Hugues.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 6 Apr 2013 07:28:10 -0600
> From: Richard Greenwood <richard.greenwood at gmail.com>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Subject: Re: [postgis-users] unique id in QGIS/PostGIS
> Message-ID:
>         <CAHBySPbH3MNH35tVh952Zdsx7try8FE-NJ7718zBne=
> rPF7T9w at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Sat, Apr 6, 2013 at 2:18 AM, Margie Roswell <mroswell at gmail.com> wrote:
>
> > I've been googling up a storm, now that I've got a local postgis database
> > with QGIS. But still haven't figured out how to display a newly created
> > table.
> >
> > The query I used to create the table:
> > CREATE TABLE smaller_leg_final AS
> > SELECT ST_Buffer(geom,-500) AS geom, legislative_final.district
> > FROM legislative_final
> > WHERE area > 30;
> >
> > I then discovered that I needed a unique ID, and did the following:
> > ALTER TABLE smaller_leg_final ADD COLUMN id serial not null;
> >
>
>
> Why don't you try making you unique column a primary key?
>
> ALTER TABLE smaller_leg_final
>   ADD CONSTRAINT smaller_leg_final_pk PRIMARY KEY(id);
>
> Rich
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/postgis-users/attachments/20130406/6be6a245/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 9
> Date: Sat, 6 Apr 2013 10:31:56 -0400
> From: Margie Roswell <mroswell at gmail.com>
> To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
> Subject: Re: [postgis-users] unique id in QGIS/PostGIS
> Message-ID:
>         <CAPAc6WEOuWT_bvJLO=
> Nrr41DRXU29aPwVQSJKgNsPas2cpX0Qw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thanks. I went ahead and created the primary key as directed. Still no
> luck. I created this mini-screencast so you can see what I'm talking about
> http://screencast.com/t/9WMkHN56e
>
> and adding on a few more seconds, here:
> http://screencast.com/t/DCjs2OXsew
>
> and a quick screenshot here, showing the data
> http://screencast.com/t/fImccBVh
>
> (sorry, I didn't get all that in one pass.)
>
> I should add that the original Maryland Legislative district is here:
>
> http://planning.maryland.gov/PDF/Redistricting/2010zip/Legislative_shape.zip
>
> The PRJ file reads as follows
>
> GEOGCS["GCS_GRS_1980",DATUM["D_GRS_1980",SPHEROID["GRS_1980",6378137,298.2572221]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]
>
>
> Oddly enough, also, the legislature_final file ALSO doesn't list primary
> key, but it displays anyhow. In this case, I've selected the ones with area
> > 25, because I thought they'd be more likely to buffer successfully...
>
> Anyhow, maybe with the mini-video screencast, it'll be easier to see what
> I'm talking about.
>
> Margie
>
>
>
> Margie
>
> --
> http://FarmBillPrimer.org
> http://www.BaltimoreUrbanAg.org (Please send events; This site is hungry.)
> http://www.ExcellentNutrition.org
> http://www.packtpub.com/drupal-5-views-recipes/book
>
>
> On Sat, Apr 6, 2013 at 9:28 AM, Richard Greenwood <
> richard.greenwood at gmail.com> wrote:
>
> >
> > On Sat, Apr 6, 2013 at 2:18 AM, Margie Roswell <mroswell at gmail.com>
> wrote:
> >
> >> I've been googling up a storm, now that I've got a local postgis
> database
> >> with QGIS. But still haven't figured out how to display a newly created
> >> table.
> >>
> >> The query I used to create the table:
> >> CREATE TABLE smaller_leg_final AS
> >> SELECT ST_Buffer(geom,-500) AS geom, legislative_final.district
> >> FROM legislative_final
> >> WHERE area > 30;
> >>
> >> I then discovered that I needed a unique ID, and did the following:
> >> ALTER TABLE smaller_leg_final ADD COLUMN id serial not null;
> >>
> >
> >
> > Why don't you try making you unique column a primary key?
> >
> > ALTER TABLE smaller_leg_final
> >   ADD CONSTRAINT smaller_leg_final_pk PRIMARY KEY(id);
> >
> > Rich
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/postgis-users/attachments/20130406/59e47305/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
> End of postgis-users Digest, Vol 134, Issue 4
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130406/afad0332/attachment.html>


More information about the postgis-users mailing list