[postgis-users] Absolute Beginner

Paragon Corporation lr at pcorp.us
Tue Apr 22 11:53:50 PDT 2008


Bob,

David is right.  You are probably running an early 1.2 or 1.1 install.

SELECT postgis_full_version() 

Is slightly better to run - it will give you details of Geos too.


ST is the new naming convention.  For things that use spatial indexes, it
automagically includes the spatial index operators

For example

 geom1 && geom2  AND Intersects(geom1,geom2)

is equivalent to
ST_Intersects(geom1,geom2)


For the examples I provided below, those don't use spatial indexes so they
are equivalent to the ones without the ST_ 

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Dave
Potts
Sent: Tuesday, April 22, 2008 1:59 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Absolute Beginner

Bob Pawley wrote:

I suspect your not using the latest version of postgis.  The command select
postgis_version(); will return which version use are using.

D.
> Thanks Regina
>
> My version of PostgreSQL has no functions that start with ST_ such as 
> ST_GeomFromText.
>
> I removed the ST_ from the code you suggested making it GeomFromText 
> and it worked well.
>
> What does the ST_ signify??
>
> Bob
> ----- Original Message ----- From: "Obe, Regina" 
> <robe.dnd at cityofboston.gov>
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Sent: Tuesday, April 22, 2008 5:21 AM
> Subject: RE: [postgis-users] Absolute Beginner
>
>
> Bob,
>
> Unfortunately I'm not too familiar with Delphi (aside from its some 
> Pascal derivative) and I guess no one is in this group since no one 
> responded to your question.
>
> I guess it depends what Delphi is expecting for the Canvas - e.g. can 
> it use SVG maybe or most unlikely (WKT  or WKB representations).  At 
> anyrate I suspect you are more likely to find Delphi plugins for 
> rendering SVG than any other format output by PostGIS.
>
> If you can find SVG plugins, there is an asSVG function in PostGIS 
> that may prove useful to you.
>
> As far as storing the path, you could put it in your database as a 
> LINESTRING of the form
>
> INSERT INTO temppath(fieldname)
> VALUES(ST_GeomFromText('LINESTRING(1 2,3 12)'))
>
> You can ignore use of SRID since you don't care about Geography.
>
> Then query it as SVG format with
>
> SELECT AsSVG(fieldname)
> FROM temppath
>
> or expand it out to x and y with something like
>
> SELECT somekeyfield, ST_x(the_geom) as x, ST_y(the_geom) as y FROM 
> (SELECT somekeyfield, ST_PointN(fieldname, generate_series(1,
> ST_numpoints(fieldname)) As the_geom
> FROM temppath)  as foo
>
> That will give you the x and y coordinates of each point of the line 
> string (with all belonging to the same linestring having the same 
> somekeyfield
>
> and then you can just plot the x and y on canvas.
>
> Hope that helps,
> Regina
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> Bob Pawley
> Sent: Monday, April 21, 2008 1:25 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Absolute Beginner
>
> I know that most, if not all, on this list are interested in the 
> geography side of GIS.
>
> However, I have a question on the geometry side.
>
> I have a Delphi Canvas that I need to connect to a PostgreSQL database.
>
> What is the minimum table structure that is needed to hold the vector 
> coordinates such as this path ((1,2), (3, 12)) so that it will draw 
> the line in Delphi?
>
> Perhaps the Delphi knowledgeable people can let me know if the 
> following query is any where near correct to accomplish this action.
>
> Thanks in advance.
>
> Bob
>     PSQLQuery1.Close;
>      PSQLQuery1.SQL.Clear;
>      PSQLQuery1.SQL.Add ('Select * fieldname ');
>      PSQLQuery1.SQL.Add ('FROM temppath');
>      PSQLQuery1.Prepare;
>      PSQLQuery1.Open;
>      PSQLQuery1.First ;
>      i2:= PSQLQuery1.FieldByName('fieldname').AsInteger ;
>      testfrm:= IntToStr(i2);
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> -----------------------------------------
> The substance of this message, including any attachments, may be 
> confidential, legally privileged and/or exempt from disclosure 
> pursuant to Massachusetts law. It is intended solely for the 
> addressee. If you received this in error, please contact the sender 
> and delete the material from any computer.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users






More information about the postgis-users mailing list