comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » esri shape file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
esri shape file [message #25781] Tue, 17 July 2001 14:14 Go to next message
HILBERMAN is currently offline  HILBERMAN
Messages: 7
Registered: July 2001
Junior Member
Hello,

I need some help figuring out how to manipulate shape files. Is there
a "straightforward" way to graphically display a polygon coverage?
Furthermore, how can I query a polygon coverage based on its different
levels (attributes?)?

Thanks!
Rachael
Re: ESRI shape file [message #72332 is a reply to message #25781] Mon, 30 August 2010 03:05 Go to previous messageGo to next message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Aug 28, 4:31 am, Klemen <klemen.zak...@gmail.com> wrote:
> There is an example of creating a point shape file in Help as Max said
> (see below). Creating a polygon is sligtly more difficult; if you need
> such an example let me know.
> Cheers, Klemen
>
> PRO ex_shapefile_newfile
>
> ;Create the new shapefile and define the entity type to Point
> mynewshape=OBJ_NEW('IDLffShape', FILEPATH('cities.shp', $
>    SUBDIR=['examples', 'data']), /UPDATE, ENTITY_TYPE=1)
>
> ;Set the attribute definitions for the new Shapefile
> mynewshape->AddAttribute, 'CITY_NAME', 7, 25, $
>    PRECISION=0
> mynewshape->AddAttribute, 'STAT_NAME', 7, 25, $
>    PRECISION=0
>
> ;Create structure for new entity
> entNew = {IDL_SHAPE_ENTITY}
>
> ; Define the values for the new entity
> entNew.SHAPE_TYPE = 1
> entNew.BOUNDS[0] = -104.87270
> entNew.BOUNDS[1] = 39.768040
> entNew.BOUNDS[2] = 0.00000000
> entNew.BOUNDS[3] = 0.00000000
> entNew.BOUNDS[4] = -104.87270
> entNew.BOUNDS[5] = 39.768040
> entNew.BOUNDS[6] = 0.00000000
> entNew.BOUNDS[7] = 0.00000000
> entNew.N_VERTICES = 1 ; take out of example, need as workaround
>
> ;Create structure for new attributes
> attrNew = mynewshape ->GetAttributes(/ATTRIBUTE_STRUCTURE)
>
> ;Define the values for the new attributes
> attrNew.ATTRIBUTE_0 = 'Denver'
> attrNew.ATTRIBUTE_1 = 'Colorado'
>
> ;Add the new entity to new shapefile
> mynewshape -> PutEntity, entNew
>
> ;Note that because this is a new shapefile, the index of
> ;the new entity is zero.
> entity_index=0
>
> ;Add the Colorado attributes to new shapefile.
> mynewshape -> SetAttributes, entity_index, attrNew
>
> ;Close the shapefile
> OBJ_DESTROY, mynewshape
>
> END

thanks. it works perfect.
Cheers,
Dave
@ Dear Klemen. Thanks I jut want to create a point point shape file.
Re: ESRI shape file [message #72340 is a reply to message #25781] Sat, 28 August 2010 04:31 Go to previous messageGo to next message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
There is an example of creating a point shape file in Help as Max said
(see below). Creating a polygon is sligtly more difficult; if you need
such an example let me know.
Cheers, Klemen


PRO ex_shapefile_newfile

;Create the new shapefile and define the entity type to Point
mynewshape=OBJ_NEW('IDLffShape', FILEPATH('cities.shp', $
SUBDIR=['examples', 'data']), /UPDATE, ENTITY_TYPE=1)

;Set the attribute definitions for the new Shapefile
mynewshape->AddAttribute, 'CITY_NAME', 7, 25, $
PRECISION=0
mynewshape->AddAttribute, 'STAT_NAME', 7, 25, $
PRECISION=0

;Create structure for new entity
entNew = {IDL_SHAPE_ENTITY}

; Define the values for the new entity
entNew.SHAPE_TYPE = 1
entNew.BOUNDS[0] = -104.87270
entNew.BOUNDS[1] = 39.768040
entNew.BOUNDS[2] = 0.00000000
entNew.BOUNDS[3] = 0.00000000
entNew.BOUNDS[4] = -104.87270
entNew.BOUNDS[5] = 39.768040
entNew.BOUNDS[6] = 0.00000000
entNew.BOUNDS[7] = 0.00000000
entNew.N_VERTICES = 1 ; take out of example, need as workaround

;Create structure for new attributes
attrNew = mynewshape ->GetAttributes(/ATTRIBUTE_STRUCTURE)

;Define the values for the new attributes
attrNew.ATTRIBUTE_0 = 'Denver'
attrNew.ATTRIBUTE_1 = 'Colorado'

;Add the new entity to new shapefile
mynewshape -> PutEntity, entNew

;Note that because this is a new shapefile, the index of
;the new entity is zero.
entity_index=0

;Add the Colorado attributes to new shapefile.
mynewshape -> SetAttributes, entity_index, attrNew

;Close the shapefile
OBJ_DESTROY, mynewshape

END
Re: ESRI shape file [message #72343 is a reply to message #25781] Fri, 27 August 2010 15:22 Go to previous messageGo to next message
Maxwell Peck is currently offline  Maxwell Peck
Messages: 61
Registered: February 2010
Member
On Aug 27, 11:03 pm, Dave Poreh <d.po...@gmail.com> wrote:
> Folks
> I have some (lon, lat, Z) data (data with coordinates) and I want to
> save this data in .shp (ESRI shape file) file (in GIS it is so easy).
> Does anyone have any idea?
> Cheers,
> Dave
> P.S. I wish David was here because he has lots of experience in shape
> files data:-(

If you must use IDL there is an IDLffShape object. Search for this in
the help theres a link with examples for reading and writing there.
the tools in GDAL are definitely easier though if its just a straight
out conversion.

Max
Re: ESRI shape file [message #72358 is a reply to message #25781] Fri, 27 August 2010 07:16 Go to previous messageGo to next message
mankoff is currently offline  mankoff
Messages: 131
Registered: March 2004
Senior Member
On Aug 27, 6:03 am, Dave Poreh <d.po...@gmail.com> wrote:
> Folks
> I have some (lon, lat, Z) data (data with coordinates) and I want to
> save this data in .shp (ESRI shape file) file (in GIS it is so easy).
> Does anyone have any idea?
> Cheers,
> Dave
> P.S. I wish David was here because he has lots of experience in shape
> files data:-(

Not sure what OS you are using, but on *nix the tools gpsbabel and
ogr2ogr (via GDAL) can do this conversion for you.

-k.
Re: ESRI shape file [message #88863 is a reply to message #72340] Sun, 29 June 2014 14:43 Go to previous message
ca11h is currently offline  ca11h
Messages: 3
Registered: June 2014
Junior Member
Hi Klemen! I know this post is years old but I'm a student helping one of the researchers out at my school as he's hired me to do some IDL work...and well I've landed here searching for help.

If you get this I'd appreciate that polygon shapefile example you mentioned. I have a binary mask with many polygons and I need to turn it into a shapefile, and there's absolutely no resources helping me out online, save for possibly this post. If you could post that example or give me any advice at all I'd really appreciate it!



On Saturday, August 28, 2010 7:31:17 AM UTC-4, Klemen wrote:
> There is an example of creating a point shape file in Help as Max said
> (see below). Creating a polygon is sligtly more difficult; if you need
> such an example let me know.
> Cheers, Klemen
>
>
> PRO ex_shapefile_newfile
>
> ;Create the new shapefile and define the entity type to Point
> mynewshape=OBJ_NEW('IDLffShape', FILEPATH('cities.shp', $
> SUBDIR=['examples', 'data']), /UPDATE, ENTITY_TYPE=1)
>
> ;Set the attribute definitions for the new Shapefile
> mynewshape->AddAttribute, 'CITY_NAME', 7, 25, $
> PRECISION=0
> mynewshape->AddAttribute, 'STAT_NAME', 7, 25, $
> PRECISION=0
>
> ;Create structure for new entity
> entNew = {IDL_SHAPE_ENTITY}
>
> ; Define the values for the new entity
> entNew.SHAPE_TYPE = 1
> entNew.BOUNDS[0] = -104.87270
> entNew.BOUNDS[1] = 39.768040
> entNew.BOUNDS[2] = 0.00000000
> entNew.BOUNDS[3] = 0.00000000
> entNew.BOUNDS[4] = -104.87270
> entNew.BOUNDS[5] = 39.768040
> entNew.BOUNDS[6] = 0.00000000
> entNew.BOUNDS[7] = 0.00000000
> entNew.N_VERTICES = 1 ; take out of example, need as workaround
>
> ;Create structure for new attributes
> attrNew = mynewshape ->GetAttributes(/ATTRIBUTE_STRUCTURE)
>
> ;Define the values for the new attributes
> attrNew.ATTRIBUTE_0 = 'Denver'
> attrNew.ATTRIBUTE_1 = 'Colorado'
>
> ;Add the new entity to new shapefile
> mynewshape -> PutEntity, entNew
>
> ;Note that because this is a new shapefile, the index of
> ;the new entity is zero.
> entity_index=0
>
> ;Add the Colorado attributes to new shapefile.
> mynewshape -> SetAttributes, entity_index, attrNew
>
> ;Close the shapefile
> OBJ_DESTROY, mynewshape
>
> END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: A case for lookarounds in StRegEx()
Next Topic: IDL code running error in envi environment(ENVI + IDL)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:13:52 PDT 2025

Total time taken to generate the page: 0.00669 seconds