I have defined a content type with a geospatial data field that stores geometries in Greek Grid Reference System (EPSG:2100). I have inserted the data makeing use of Textfield Widget.
I have also configure the PostGIS Formatter Map and PostGIS Widget Map in OpenLayers Maps so as to use 900913 projection (Google Projection).
But when I view my content, the spatial data appears in North Africa, Algeria. It is supposed that it will perform on-the-fly projection from Greek Grid to 900913. Did I make any mistakes with the configuration?
Comments
Comment #1
friedjoff commentedRight now only WGS 84 (EPSG:4326) works properly because projection support of the OpenLayers Module is rather limited at the moment. In your case a reprojection done by the formatter of the PostGIS module should work. I'll have a closer look into this and let you know ASAP.
Another option would be using Proj4js.
Comment #2
kokkytos commentedThank you for your quick rensponse! I need to provide my data in Greek Grid R.S. and not in WGS'84. Yes, Proj4js is powerful but I don't know how to use it in drupal and its modules.
I can provide you some sample date in Greek Grid in case you need them.
Comment #3
friedjoff commentedHi kokkytos,
the new dev release will handle on-the-fly reprojection for PostGIS fields if an OpenLayers map is used as a display format. Can you please test if this works in your case?
Update: you will need to update the PostGIS module to a current development release. Just replace the code at [cartaro]/profiles/cartaro/modules/contrib/postgis with a current download from http://drupal.org/project/postgis
Thanks,
friedjoff
Comment #4
kokkytos commentedfriedjoff, thank you! I'll check it and I'll inform you as soon as possible.
Comment #5
kokkytos commentedOk, I test it and I get the following error:
PDOException: SQLSTATE[42725]: Ambiguous function: 7 ERROR: function st_transform(unknown, unknown) is not unique LINE 1: SELECT ST_Transform('010600002034080000010000000103000000020... ^ HINT: Could not choose a best candidate function. You might need to add explicit type casts.: SELECT ST_Transform(:geometry, :srid); Array ( [:geometry] => 0106000020340800000100000001030000000200000071000000C99239F6DB800A4187360040B77F50417896206326AD0A4198DF69331F7F50410D8AE6417BB60A41E413B2DFE97E50415AB9175882BD0A4150560C18E27E50418411FB24B1BF0A4191D4427ADB7E5041BC783F8E4BBF0A41D4601A3AD27E5041007503E531BF0A41ECBE63BACC7E5041A33CF392EBBE0A41A94C313AC47E5041161571DA85BE0A41BA8619BAB97E5041804754E841BE0A416D8E73FAB27E5041B6A2CD71FCBD0A412A1C417AAA7E5041EE96E4E055BD0A41D1402C7A937E50413AAFB18B4FBD0A41F69B897A8C7E5041959BA8C546BD0A410FD2533A847E50412BF9D8DD3DBD0A415B0C1EFA7B7E5041F9122A7824BD0A414166677A767E504110CF12E4E9BC0A4177F52ABA6E7E5041EAAF577874BC0A41ECFB707A697E5041B726DD763CBC0A41013109FA647E5041BE11DD73F8BB0A413B376D7A5D7E50410BB77C24B1BB0A41C5724BBA537E5041EB6E9E8A8BBB0A41B552087A4C7E504103CE52926FBB0A41DAAD657A457E50416876DD9BCDBA0A41823CBB374A7E5041C32B495E30B80A41035B2588567E504142226DA335B80A4134F279FD577E504103B518FC52B80A4133315D1C607E5041EEB25F7705B90A41A1F5F07F917E504143E21E0B8BB80A41DE3CD539957E504189B2B734A5B70A419C6C0350947E504161191B9A82B70A411CB11623977E50417C42765EDAB60A41ED28CEE49E7E50414DD87ED234B60A413561FB279D7E50419CA223991FB60A412BFC1903987E50418BFED00CF6B50A4181B229D28F7E504102B8591C95B50A4199F5627B887E50411381EAFF13B50A416397A8D8847E50411B84B95D11B50A410586ACC5847E5041DFDC5F9DA4B40A4113BBB6B5817E5041FBAD9DE88CB30A414DC0AFB67E7E5041CDCAF661C4B10A41B8EA3AC17A7E5041AAEE916D5EB00A41A4E194677A7E5041CC99EDEAB3AF0A41D4B9A2987C7E5041408523889DAD0A41DC9BDFAE857E50412E71E481BEAC0A41DFC490EA877E5041554E7B0A79AA0A418BA54868897E5041C975532A97A90A41062D24648E7E50416EA29626CDA70A418063CF5D987E504166F84FD734A60A41024BAEC2A37E5041C4094CC7BDA40A414E6210EAB37E50414CC2857CA5A30A419DA1B888BA7E5041D1C9524BC3A20A419D685738BA7E5041BD55D701DEA10A418061F975BC7E5041944F8F2D57A00A41F5BC1BFBC47E504189B7CE7F679E0A4144A51147CE7E50417365502D638F0A411A4D2ED3BB7E504165C22F35AE8F0A416EFC892DCB7E5041852689E5978F0A41FDDB654DD57E50412FDD24E6358F0A41C022BFD4DF7E50419EB470B9978E0A41AF777F77E87E5041B9AB57B1BD8D0A412BDF3351F07E504187C1FC35B48C0A41739D46E1F57E50417CB5A3B8998B0A412FC37FF9F97E50418621729A448A0A415C751D9EFC7E5041662D05C4CF880A4184F4148BFC7E50417AC212AF9D870A411005338EFA7E50416919A9B770860A411DE560EAF67E50418FA9BB5268850A4113D21A71F27E504140C1C5AA77840A4106F698C1EB7E504148A5D891B9830A412332ACE2E47E504171AB20C6CD820A418ECC23F5E87E5041B1868B9CF1810A41AED51E5CED7E50415A65A65421810A416EDA8C59F27E5041744694965E800A41397D3D24FA7E5041C1AA7A59687E0A41677C5FADF47E50411E87C11C347E0A413BFE0B2AF77E50410B9A9698097D0A41336B29EE107F50415F46B19C8B7B0A416938653B0F7F5041DD7877C450760A415F0B7A51187F50413370404B65740A412AE109FE0F7F5041295C8F8228740A41A9BC1D040F7F504129E961085D730A4107B29EDD0E7F5041B8223161ED6D0A414EED0C59247F5041809A5AF693710A414E0D34526B7F504196B20CF1A8710A41C3103907727F50410CB1FA037B710A412026E1DE717F50411D90843D05710A41E692AAFE727F50418DB800749D700A412DCF8347757F504159F8FA7A7D700A418272DBD4797F504129EB3733A7700A411EDFDE1D7D7F50416490BB8802710A411893FEF27F7F5041FC56EBA463710A412827DA61827F5041FFEBDCD4F7710A41AC1DC589857F50414F232D9534720A4135971BFF887F50415FEB520364720A41CD3D24D58D7F50416ADAC5B4F9640A418CF337FAA47F5041BE2EC3DFE8640A4136204217A57F504171016874CA590A4190300CC98E7F5041F1845E7F5F4E0A41B26323F0777F5041EA961DC2DD4B0A41E1B4E08C727F5041B610E440504B0A41EA3F6B0B717F5041029B73F0494B0A417CD11E10767F50419A0B5CDE414B0A41F111317A7C7F5041CA181F264D4B0A41C37E4F7A867F5041ABD0408C274B0A41E696563A927F504124B6BB27014B0A41D55C6EBA9C7F50417D23BA87D74A0A4100ADF979A57F50413A3FC591984A0A418ACBF144AC7F5041F52F4905D34A0A417364E550AD7F5041F7AB005F0D4D0A4179909E2BB77F5041103E9428E1760A41AD85592D70805041C53BC0531B7E0A4193020BD022805041C99239F6DB800A4187360040B77F50410C0000001B65FDE662870A418733BFA92D7F50410F9887CCB08C0A41A1A17FB4517F5041E371518DBD8A0A41BF10725E7C7F5041F415A43976830A418AAE0B4F8B7F5041EBFCDBE54B800A419F1F465C607F5041DCBC71B2587F0A410B60CABC537F50416F6248CEB6830A41CAFE7979427F5041FCA6B07221830A4120D3DA433A7F5041CCD1E3D77B840A41BA675D09347F5041091A33A948840A417B32FF74307F504107B29EBA9E860A419DA1B895287F50411B65FDE662870A418733BFA92D7F5041 [:srid] => 900913 ) in PostgisGeometry->transform() (line 492 of C:\xampp\htdocs\archaeology\profiles\cartaro\modules\contrib\postgis\includes\postgis.geometry.inc).Comment #6
augustus.kling commentedThanks for letting us know. Can you please check that you have exactly 1 function named
st_transform. The following query should result in 1 row.Please name the versions of Postgres and PostGIS you are using. Do also describe how you installed PostGIS since this information helps us to narrow down the causes for any errors.
Comment #7
friedjoff commentedI've just added geometry transformation for the OpenLayers widget type. Now you can't just view but also edit spatial data of any PostGIS supported projection in OpenLayers. But keep in mind that accuracy will be limited to OpenLayers supported projection.
Comment #8
kokkytos commentedHi, I run the query and as result I've gοt 4 rows !
I have Postgres 9.2.1 and PostGIS 2.0
As far as I remember I installed PostGIS from a template:
CREATE DATABASE my_spatial_db TEMPLATE=template_postgisComment #9
augustus.kling commentedPlease reopen if you still get the error with recent Cartaro versions.