Hi I need help.
I’m trying to copy features from postgreslayer to inmemory layer…
But npgsql hasn’t implemented asbinary(geometry)
My code works when I try to copy from shapefilelayer, but how can I do the same from postgreslayer?
PostgreSqlFeatureSource fs = new PostgreSqlFeatureSource(“connection”,“tablename”,“gid”);
fs.Open();
//GetAllFeatures is where the problems starts…
//Npgsql.NpgsqlException: Npgsql.NpgsqlException : ERROR: 42883: function asbinary(geometry) does not exist
foreach (Feature item2 in fs.GetAllFeatures(ReturningColumnsType.AllColumns))
{
Returncolumnstype postgres featuresource?
Hi Niels,
Can you tell me the version of your Npgsql.dll? Our latest version is 2.0.11.93 and it works fine with GetAllFeatures. You can find it in the daily build->Product/Spatial Extensions/Postgre Extension.
Thanks,
Edgar
2.0.11.94, But what version of postgis are you using?
select postgis_full_version()
"POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8"
I'm using version 2. and under functions there is no function called asbinary(geometry) however there is a function prefixed with st_ called st_asbinary(geometry)
trac.osgeo.org/postgis/wiki/FAQ
When were the ST_* functions first added to match the SQL-MM-centric convention?
For example only ST_AsBinary has been upgraded to work with the new geography type because AsBinary should not be being used anymore.
Niels,
Our version is 2.0.11.93, and we cannot use the 2.0.11.94, however, we’ve changed all the AsBinary to ST_AsBinary in our code, and it works fine with the 2.0.11.93 version, I think it will also work fine with your version, please get the latest extension in or after 6.0.88.0 or 6.0.0.88 and have a try.
Thanks,
Edgar
Ok I’ll try, however 6.0.86.0 is the newest I can see in daily dev builds? and 6.0.0.87 is newest in daily prod build
Confirmed - It works fine with 6.0.88.0 :)
Niels,
Glad to hear that, if you have any questions please let me know.
Regards,
Edgar