Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: DBI placeholders for spatial data

by Bod (Parson)
on Jun 26, 2021 at 10:37 UTC ( [id://11134323]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI placeholders for spatial data
in thread DBI placeholders for spatial data

Is there another constructor for your POINT objects that accepts coordinates separately?

There is ST_PointFromText but it looks like it is just a synonym for ST_GeomFromText.

Replies are listed 'Best First'.
Re^3: DBI placeholders for spatial data
by Anonymous Monk on Jun 26, 2021 at 10:45 UTC
    I think that the Site::Point class will benefit from an as_wkt method (or similar) returning strings that you could feed to ST_GeomFromText via placeholders like select ST_GeomFromText(?, ?).
      I think that the Site::Point class will benefit from...

      Agreed.

      The sql method now returns just the POINT code instead of the complete ST_GeomFromText string. This allows me to do something like this:

      my $point = Site::Point->new('SO 1230 4560'); $dbh->do("INSERT INTO Test SET start = ST_GeomFromText( ? , 4326)", un +def, $point->sql);
      As 4326 is a constant (as long as I am only dealing with this planet!) it doesn't need a placeholder.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found