I am using Spatialite, an extension of SQlite and I have some problems running the transform function.

According to the Spatialite functions page (http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.0.html), the transform function should take in a geometry object and an integer of the SRID that I want to transform an object to, and then output a geometry.

I did the following query, but I'm always given a NULL output.

SELECT Transform ((SELECT Geometry FROM healthierdining), 3414)

I have checked that Geometry FROM healthierdining is indeed of type geometry, and yes, I have PROJ.4 version Rel. 4.6.1 installed. What could possibly be wrong with this code?

  • Is EPSG:3414 defined in your spatialite? Check SELECT * FROM spatial_ref_sys WHERE srid = 3414 – Zoltan Feb 4 '16 at 6:54
  • SQL is wrong, use SELECT Transform(Geometry, 3414) FROM healthierdining; – user30184 Feb 5 '16 at 13:37
  • @Zoltan it returns "no such table spatial_ref_sys". What should I do to define it my spatialite? – Melissa Lim Mar 8 '16 at 2:25
  • I suppose it is an installation issue, Go through the installation guide for your operating system. – Zoltan Mar 9 '16 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.