use ShapeFile object like ogr2ogr?

Topics: SharpMap Project
Nov 23, 2008 at 9:23 AM
Hi,

I'd like to be able to parse a shapefile like the ogr2ogr utility.

Say I have a shapefile with many polygon features.

I'd like to open the .shp file and create a ShapeFile object.

Then I'd like to be able to iterate through the features in the ShapeFile object and save each one to a new ShapeFile using the 'NAME' attribute in the file name.

How would I do that?

Thanks

Kimball
Coordinator
Nov 24, 2008 at 4:02 PM
Edited Nov 25, 2008 at 9:50 AM
Hi Kimball, for v2 there is a new demo console project which does exactly this (SharpMap.Demo.FeatureExporter) - current limitation is that it doesn't export the prj file
hth jd

UPDATE: limitation removed
Nov 28, 2008 at 10:45 AM

John,

That’s great news!

However, I have no clue whether you mean to say that it is coming or whether its available.

I can find no such namespace in any of the examples or releases on the codeplex sites.

Is this a future item or can you tell me where to find it?

Thanks

Kimball

From: johndiss [mailto:notifications@codeplex.com]
Sent: Monday, November 24, 2008 8:03 AM
To: Kimball Johnson
Subject: Re: use ShapeFile object like ogr2ogr? [SharpMap:40562]

From: johndiss

Hi Kimball, for v2 there is a new demo console project which does exactly this (SharpMap.Demo.FeatureExporter) - current limitation is that it doesn't export the prj file
hth jd

Read the full discussion online.

To add a post to this discussion, reply to this email (SharpMap@discussions.codeplex.com)

To start a new discussion for this project, email SharpMap@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com



This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake, please let us know by e-mail reply and delete it from your system; you may not copy this message or disclose its contents to anyone. Please send us by fax any message containing deadlines as incoming e-mails are not screened for response deadlines. The integrity and security of this message cannot be guaranteed on the Internet.
Coordinator
Nov 28, 2008 at 10:54 AM
Hi Kimball, the v2 source tree is currently at http://sharpmapv2.googlecode.com You will need a subversion client to check it out hth jd
Nov 30, 2008 at 1:08 AM
Thanks, John.

That is a very clean example, runs very fast and is exactly the output I got after beating on it with the powershell stick and the ogr rock for about 8 hours.

Great Job!