When I'm trying to save a new point I get the error:
Unable to parse WKT (POINT(4 6))

Comments

friedjoff’s picture

Can you please provide more information on how to reproduce the error? At first sight the outer braces look strange to me. Did you enter the WKT by hand?

kokkytos’s picture

Sorry the outer braces is my mistake. The true message is here:
Unable to parse WKT: POINT(1.52109 42.50779)
I didn't enter the WKT, I used OpenLayers Map to add/edit point.

kokkytos’s picture

There is no special need to reproduce the error. I install the Cartaro distribution with demo data (Capitals). After that, I tried to add a Capital and when I saved it I got the error message. The same error also appears when I'm editing a Capital.

friedjoff’s picture

Can you tell me which version of PHP, PostgreSQL and PostGIS you're using (Administration > Reports > Status reports)?

kokkytos’s picture

OK
PHP 5.4.4
PostGIS 2.0
PostgreSQL 9.2.1

The problem was with 7.x-1.x-dev
I installed 7.x-1.0-beta1 and there is no problem. Maybe there was a misconfiguration
Thank you for you time!

friedjoff’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

irishsetter’s picture

Facing same issue here.
Unable to parse WKT: POINT(54.36667 24.46667)

Drupal 7.22
Install profile Cartaro (cartaro-7.x-1.0)
Database system PostgreSQL
Database system version 9.2.4
Database updates Up to date
Drupal core update status Up to date
PHP 5.3.15 (Mountain Lion)
PostGIS 2.0
Web server Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/0.9.8x

irishsetter’s picture

Status: Closed (fixed) » Active

My bad, had a duplicated POSTGIS. I realized after debugging and seeing the exception:

Unable to parse WKT: POINT(-5273543.4561062 -1603954.5996489) exception 'PDOException' with message 'SQLSTATE[42725]: Ambiguous function: 7 ERROR: function st_geometrytype(unknown) is not unique

Dropping the extension (DROP EXTENSION postgis_topology;) solved the problem.

irishsetter’s picture

Title: Unable to parse WKT » SOLVED: Unable to parse WKT
Status: Active » Closed (fixed)
aquavitae’s picture

I'm getting this too:

Unable to parse WKT: POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))

If I execute the query directly in psql it works though:

# SELECT ST_GeometryFromText('POLYGON((2709417.4939864 -3552303.9350701,2717061.1968139 -3563310.8671416,2728679.6251116 -3549552.2020522,2709417.4939864 -3552303.9350701))'); 
                                                                    st_geometryfromtext                                                                     
------------------------------------------------------------------------------------------------------------------------------------------------------------
 0103000000010000000400000044F23ABFD4AB44418560B0F7171A4BC1A8323199C2BA4441F77EFE6E972F4BC12BA803D073D14441B4D8DC19B8144BC144F23ABFD4AB44418560B0F7171A4BC1
(1 row)

Digging through the code in postgis.geometry.inc, it looks like it is trying to do SELECT ST_GeometryType('POLYGON(...)'); instead of SELECT ST_GeometryType(ST_GeometryFromText('POLYGON(...)')); which might be the problem, but I'm not particularly familiar with php or postgis so I could be reading it incorrectly.

milos.kroulik’s picture

Title: SOLVED: Unable to parse WKT » Unable to parse WKT when postgis_topology extension is enabled on the database.
Project: Cartaro » PostGIS
Component: Miscellaneous » Documentation
Issue summary: View changes
Status: Closed (fixed) » Active

I experienced the same problem as irishsetter. Perhaps it should be mentioned, that PostGIS module isn't compatible with postgis_topology extension. Or am I missing something?