Creating an Arc

View: New views
8 Messages — Rating Filter:   Alert me  

Creating an Arc

by Sling Blade :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I need to create an Arc in a shape file. Is this possible using shapelib? My
understanding is that only points, polylines and polygons can be created so
what I probably need is a way to convert an Arc to a collection of
Polylines, is that correct?

 
Does any one have an example of creating Arcs they can share with me?


Regards

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

Re: Creating an Arc

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott Ferguson wrote:
> Hi,
>
> I need to create an Arc in a shape file. Is this possible using shapelib? My
> understanding is that only points, polylines and polygons can be created so
> what I probably need is a way to convert an Arc to a collection of
> Polylines, is that correct?
>
>  
> Does any one have an example of creating Arcs they can share with me?

Scott,

You are correct that shapefiles cannot store curved arcs.  The normal
technique is to approximate them as polylines.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

Re: Creating an Arc

by Sling Blade :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You are correct that shapefiles cannot store curved arcs.  The normal
technique is to approximate them as polylines.


What would be great would be to learn how to approximate an Arc with Polylines. Do you have any code showing how this is done?

Regards

Re: Creating an Arc

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sling Blade wrote:
>
> You are correct that shapefiles cannot store curved arcs.  The normal
> technique is to approximate them as polylines.
>
>
> What would be great would be to learn how to approximate an Arc with
> Polylines. Do you have any code showing how this is done?
>
> Regards

Sling,

There is some example code for converting arcs to polylines in:

  http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogrsf_frmts/oci/ogrocistroke.cpp

A lot depends on how your arcs are defined.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

Re: Creating an Arc

by Sling Blade :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Frank!

I could make better sense of it if I could see the includes too, or at least
see the OGRLineString class.

Would it be possible for you to post them, or you could email them directly
to me if that is preferred?

Thanks again for your help

Regards,


-----Original Message-----
From: shapelib-bounces@...
[mailto:shapelib-bounces@...] On Behalf Of Frank Warmerdam
Sent: Tuesday, July 28, 2009 2:36 PM
To: Shapelib Development
Subject: Re: [Shapelib] Creating an Arc

Sling Blade wrote:
>
> You are correct that shapefiles cannot store curved arcs.  The normal
> technique is to approximate them as polylines.
>
>
> What would be great would be to learn how to approximate an Arc with
> Polylines. Do you have any code showing how this is done?
>
> Regards

Sling,

There is some example code for converting arcs to polylines in:

  http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogrsf_frmts/oci/ogrocistroke.cpp

A lot depends on how your arcs are defined.

Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

Re: Creating an Arc

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott Ferguson wrote:
> Thanks Frank!
>
> I could make better sense of it if I could see the includes too, or at least
> see the OGRLineString class.
>
> Would it be possible for you to post them, or you could email them directly
> to me if that is preferred?

Scott,

It is all part of GDAL/OGR (http://www.gdal.org).

But since the code is not written in terms of SHPObject you are going to have
to do a bunch of restructuring.  So best to treat this code as an example and
avoid dragging in the actual classes references.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

Re: Creating an Arc

by Sling Blade :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>Scott,

>It is all part of GDAL/OGR (http://www.gdal.org).

>But since the code is not written in terms of SHPObject you are going to
>have
>to do a bunch of restructuring.  So best to treat this code as an example
>and
>avoid dragging in the actual classes references.


I'll go over it and see how far I get.

I was hoping this was a common question with an obvious answer :-)

Thanks again Frank you've been a huge help!


Regards,


 


-----Original Message-----
From: shapelib-bounces@...
[mailto:shapelib-bounces@...] On Behalf Of Frank Warmerdam
Sent: Tuesday, July 28, 2009 3:31 PM
To: Shapelib Development
Subject: Re: [Shapelib] Creating an Arc

Scott Ferguson wrote:
> Thanks Frank!
>
> I could make better sense of it if I could see the includes too, or at
least
> see the OGRLineString class.
>
> Would it be possible for you to post them, or you could email them
directly
> to me if that is preferred?

Scott,

It is all part of GDAL/OGR (http://www.gdal.org).

But since the code is not written in terms of SHPObject you are going to
have
to do a bunch of restructuring.  So best to treat this code as an example
and
avoid dragging in the actual classes references.

Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib

shpproj help

by Ken S. Elvehjem :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have a set of shapefiles that are in what I have always been told are
"unprojected longitude & latitude."

X & Y coordinates are in decimal degrees ( -92.5173861 x 42. 9431848)  with
a datum of WGS84

I am trying to use shpproj to convert these files to UTM Zone data (Zone 15,
in my example) for some further analysis.

The following don't work:

shpproj jack jackson-soils-UTM -i=geographic -o="proj=utm zone=15 units=m"
shpproj jack jackson-soils-UTM -o="proj=utm zone=15 units=m"

The processis aborted with the note, "unable to process projection, exiting"

I suspect that some data files may be missing, but I have no way of figuring
that out.

BTW, the "proj"  directive "works" but doesn't give me any good clues
either.

Any suggestions would be greatly appreciated.

Ken


_______________________________________________
Shapelib mailing list
Shapelib@...
http://lists.maptools.org/mailman/listinfo/shapelib