[postgis-users] ESRI Shapes from database

Chris Hermansen chris.hermansen at timberline.ca
Tue Oct 16 10:50:16 PDT 2007


If I understand correctly, you have written a C# program to read the
geodatabase on the SQL Server and you're trying to transform that into a
string you can pass into PostgreSQL.  And your string is too big.

Given that you've got that far, why don't you just change your C#
program to write the data out to a text file (or several text files if
necessary) as SQL containing a CREATE statement, a bunch of INSERT
statements or a COPY statement (probably more efficient with such a big
table, but if your size limitation hampers you, you could fall back to
INSERTs or even a few COPY statements), and finally add a spatial index.

If you need a template for that, grab a shape file and use shp2pgsql to
generate a sample from which you can design your own output.

Then you can use psql to process that text file (those text files ).

Lee Keel wrote:
> ------------------------------------------------------------------------
>
> *From:* postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] *On Behalf Of
> *Obe, Regina
> *Sent:* Tuesday, October 16, 2007 10:40 AM
> *To:* PostGIS Users Discussion
> *Subject:* RE: [postgis-users] ESRI Shapes from database
>
>  
>
> Sorry if  my questions are kind of stupid and basic
>
>  
>
> So is the data in SQL Server 2000 nothing more than the stuff in an
> ESRI shape file but stuffed in a database (and is that an ESRI shape
> record per record or like a whole esri shape table in a SQL Server
> record).  Or is it some other format like WKB.
>
>  
>
> Is your 2GB problem for an individual geometry or for a whole shape
> table stuffed in a row or something?
>
> How did it get into SQL Server in the first place?
>
>  
>
> Thanks,
>
> Regina
>
>  
>
> */[Lee Keel] /*
>
> Regina,
>
>  
>
> A table in Sql Server is equivalent to a shape file.  A row in the
> table only contains a single shape.  The shape is an ESRI specific
> format that we have parsed apart and can determine the type of shape
> and the points that go with that shape.  The memory limit that I ran
> into is per single shape, but it is a problem with Microsoft and
> garbage collection and I can't seem to get around it.  Plus parsing
> this value and putting it in as text is very slow and I was hoping to
> speed this process up by moving the parsing and comparison into the
> database.  The shape got into Sql Server using an ESRI shape file and
> using some custom tools that we wrote.  But the users edit these
> shapes in our main product, so I can't use these shape files as part
> of the import.
>
>  
>
> BTW, I don't think these were basic nor stupid questions.  If someone
> doesn't have to deal with ESRI's shapes on a regular basis, then they
> wouldn't necessarily know this.
>
>  
>
> Thanks in advance,
>
> Lee
>
> ------------------------------------------------------------------------
>
> *The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended solely for the
> addressee. If you received this in error, please contact the sender
> and delete the material from any computer. *
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the sender. This message contains confidential information and is
> intended only for the individual named. If you are not the named
> addressee you should not disseminate, distribute or copy this e-mail.
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   


-- 
Regards,

Chris Hermansen · mailto:clh at timberline.ca
tel:+1.604.714.2878 · fax:+1.604.733.0631
Timberline Natural Resource Group · http://www.timberline.ca
401 · 958 West 8th Avenue · Vancouver BC · Canada · V5Z 1E5

C'est ma façon de parler.




More information about the postgis-users mailing list