[postgis-users] About ESRI Shapefile ...

Thomas Chabaud tc at geosys.com
Wed Apr 19 08:16:02 PDT 2006


Stephen Woodbridge a écrit :
> Thomas Chabaud wrote:
>> Sorry if it's a dumb question, but I wonder why there is no
>> "AsESRIShapefileGeometry(geometry_column)" and
>> "WKTFromESRIShapefile(esri_shapefile_geometry)" that could work like
>> AsText() or GeometryFromText() functions.
>>
>> Is it difficult to do ?
>>
>> I think it could be very useful.
> 
> Hi Thomas,
> 
> 1) A shapefile is not a file it is a set of files so what would you 
> expect to get from "AsESRIShapefileGeometry(geometry_column)"
> 
> 2) A geometry_column can contain multiple geometry type, and collection 
> which are not compatible with the ESRI Shapefile spec. What would you 
> want to happen in this case?
> 
> 3) Lets assume we had the function as you requested it. What would you 
> do with it? How would you use the result?
> 
> In general, I think that it is highly unlikely that there is any 
> interest in add this function because of the compatibility, and 
> restrictions, and the fact that I think you find that most people don't 
> think it would be all that useful given that alternatives exist and work 
> fine. But you may see a need that I don't see, and I am open to your 
> ideas on how you would use such a feature.
> 
> Regarding difficulty, you might look at the source of pqsql2shp, and 
> look at what it would take to wrap that in a stored procedure.
> 
> -Steve W.
> 
> 

Sorry, I think I have not been very explicit.
The problem is I have an application using MapObject recordsets, to access 
shapefiles.

That I would be able to do is for example call a Postgis function that could 
take a MapObject geometry in argument, in order to execute sql request like 
this :
  	SELECT AsESRIShapeFileGeometry(geometry_column) AS geom,myid,myotherfield 
FROM mytable

And then in my application I can directly pass the geometry to a MapObject 
recordset, without needing conversion
	myMOrecordset.Fields("SHAPE").Value = mysqlrecordset.Fields("geom").value
or
	SQL_Execute("INSERT INTO mytable (id,geometry_column,myfield) values 
(myid,WKTFromESRIShapefile(" & myMOrecordset.Fields("SHAPE").Value & 
"),myfield)")

Is there compatibilities problems to add such feature ?

Regards,

Thomas



More information about the postgis-users mailing list