Re: [postgis-users] ST_Intersection returning offset point on two lines which intersect

2020-04-23 Thread Paul Ramsey
You don't. If you introduce a vertex into the original line at the intersection point, then the vextexes can match up, but the new point is not necessarily representable as being on the mathematical intersection of the two inputs, it's at the closest representable point. This works, for example

[postgis-users] ST_Intersection returning offset point on two lines which intersect

2020-04-23 Thread David Campbell
Hi, I have two lines which intersect but ST_Intersection returns an offset point. Offset is around 0.26m. WITH line1 AS (SELECT ST_GeomFromText('LINESTRING(470874.945140537 6000126.53834916,470825.026548551 6000129.39039651,470813.970641131 6000131.67770864,470798.339625488 6000130.91512638,4

Re: [postgis-users] How to sql scripts in a file?

2020-04-23 Thread John Zhang
Hello Giuseppe and Sándor Daku, Thank you for the input. Yes, after conn.commit() is called, it works. Cheers, John On Thu, Apr 23, 2020 at 9:37 AM Giuseppe Broccolo wrote: > Hi John, > > I guess you are using Psycopg2 as driver to PostgreSQL here (please add > further details about your setu

Re: [postgis-users] Differences in st_transform between Postgis 2.3 and Postgis 3.0

2020-04-23 Thread David McKelvie
Thanks, Yes the postgis 3 version has PROJ="6.2.1" while the postgis 2.3 version has PROJ="Rel. 4.9.2, 08 September 2015" So quite possibly a change in proj 6. I find this quite disconcerting. This will affect how locations provided by apps using GPS will be stored in our database and we havent

Re: [postgis-users] How to sql scripts in a file?

2020-04-23 Thread Giuseppe Broccolo
Hi John, I guess you are using Psycopg2 as driver to PostgreSQL here (please add further details about your setup). Assuming Psycopg2: I guess that is because actions are not committed in your snippet. You may be interested to set autocommit for the execution of the script, even better to manage

Re: [postgis-users] Differences in st_transform between Postgis 2.3 and Postgis 3.0

2020-04-23 Thread rmrodriguez
What proj releases are you using? `Select postgis_full_version()` will show it. It is likely that your 3.0 is using PROJ6+ which has more precise transformations. On Thu, Apr 23, 2020 at 2:55 PM David McKelvie wrote: > > > Hello; > > Ive noticed a difference between the results returned by st_tr

[postgis-users] Differences in st_transform between Postgis 2.3 and Postgis 3.0

2020-04-23 Thread David McKelvie
Hello; Ive noticed a difference between the results returned by st_transform between Postgis 2.3 and Postgis 3.0 and wonder if anyone on this list might be able to explain why that is so. I have a home rolled entry in the spatial_ref_sys table for a SRID called 927700. This is the UK Ordnance S

[postgis-users] How to sql scripts in a file?

2020-04-23 Thread John Zhang
Hello all, I have a need to execute sql scripts in a file with comments in Python 2.7. here is m code snippet: sqlF = r'{}\{}'.format(sFldr_sql,sSQLFile) sql_file_contents = open(sqlF,'r').read() cur.execute(sql_file_contents) the file can be executed from pgAdmin successfully. However, the code