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

Home » Public Forums » archive » Shapefiles Gone Wild
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
Shapefiles Gone Wild [message #79474] Fri, 02 March 2012 12:03
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

Andrew Cool, an always reliable breaker of my well-written
programs, sent me an interesting shapefile problem yesterday.
In this case my programs were (mostly!) well-enough written,
but Andrew was making a common false assumption about
the shapefile he was using. Since I've run into this a
couple of times, I thought I might write an article
about it.

The assumption Andrew made (and which I have made many
times myself!) is that shapefiles always contain latitude
and longitude information. In fact, the polygons of this
particular shapefile were specified in projected meter
space. This is a bit of a problem because shapefiles do
not, generally, contain the map projection information you
need to set up a projected meter map space properly. You
have to find this map projection information elsewhere.

It is also a problem because if you wanted to set up
a projected meter map space and draw on top of it,
the normal IDL routines (i.e., Map_Continents and
Map_Grid) don't always do a very good job of that.
(And, I see evidence that the problems in this area
are being propagated into the Function Graphics map
projection routines, as well.)

Since I think most map projection programs only
make sense if you are working in projected meter
space, nearly all of my Coyote Graphics map projection
routines allow you to work in this space.

Anyway, if you are interested in why your shapefile
appears to go berserk when you open it in a shapefile
viewer that you may have obtained from someone, this
article might go a long way toward explaining the
problem. In any case, you can see how I would use
Coyote Graphics routines to solve the problem:

http://www.idlcoyote.com/map_tips/berserk.php

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Absolute paths for saving cgWindow output
Next Topic: Follow IDLCoyote on Twitter

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

Current Time: Wed Oct 08 18:52:45 PDT 2025

Total time taken to generate the page: 0.00423 seconds