Archive for the ‘Technology’ Category

Determining if a Polygon is drawn clockwise or counterclockwise

Wednesday, February 10th, 2010
According to the ESRI Shapefile Documentation,
“The neighborhood to the right of an observer walking along the ring in
vertex order is the inside of the polygon”.  Meaning that all normal or
“clean” polygons are drawn in a clockwise fashion.  When it comes to
holes in the polygons, these are defined by a counterclockwise path
delineating the polygon.
The first step to
determining if a polygon is an additive vector or a subtractive one is
to determine the direction in which the polygon is formed.  ESRI
Shapefiles do not support polygons that cross their own lines, which
makes calculating data with them a bit easier.  One method to determine
the direction the polygon is formed is by using Green’s Theorem.
This method would require one to take the current coordinate (x1,y1),
and the next one (x2,y2), and apply the following formula:
∑(x2-x1)*(y2+y1).  For each line segment, one would then need to add
the result to a running total, and if the number ends up being
positive, the polygon is clockwise, and if it is negative, the polygon
is counterclockwise.
The Formula:

Example:

KML code:

<Placemark>
<name>
Big Triangle</name>
<styleUrl>
#stdstyle</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-76, 41,0
-75, 40,0
-77, 40,0
-76, 41,0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>

(Screenshot from Google Earth)

(Figure 2.1)

Using the KML code above to create the triangle above:

Line Start Coord End Coord Equation Result
1 -76, 41 -75, 40 ((-75)-(-76))(40+41) 81
2 -75, 40 -77, 40 ((-77)-(-75))(40+40) -160
3 -77, 40 -76, 41 ((-76)-(-77))(41+40) 81
Total: 2



KML code:

<Placemark>
<name>
Small Triangle</name>
<styleUrl>
#stdstyle</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-76, 40.75,0
-76.5, 40.25,0
-75.5, 40.25,0
-76, 40.75,0

</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>

(Screenshot from Google Earth)

(Figure 2.2)

Using the KML code above to create the triangle above:

Line Start Coord End Coord Equation Result
1 -76, 40.75 -76.5, 40.25 ((-76.5)-(-76))(40.25+40.75) -40.5
2 -76.5, 40.25 -75.5, 40.25 ((-75.5)-(-76.5))(40.25+40.25) 80.5
3 -75.5, 40.25 -76, 40.75 ((-76)-(-75.5))(40.75+40.25) -40.5



Total: -0.5



There is also a really good flash based demo on how this works available online here: http://www.mechanisms101.com/greens_theorem_demo.html

Mapping the Earth’s Gravity

Tuesday, March 17th, 2009

NASA

Some places on earth have different gravities.  Gravity roughly decreases with altitude, and many things can affect it.  The linked article explains that the European Space Agency are trying to get a better image of the earth’s gravitational pull.  There is also some talk about how this study can help us understand climate models better.

Probe launches to map Earth’s gravity in best detail yet. (via New Scientist)

They have a disclaimer right on the webpage about copying content, so I used an image from NASA.  Click through to see their video on the subject.

Some more links for you:

USA Today: GPS devices aren’t always right!

Thursday, March 12th, 2009

It may seem obvious that the maps stored on GPS devices is not always correct.  Not only is the data collection itself prone to error, but they are a static snapshot.  Maps change overtime, new roads are built, natural disasters take out roads, and civil projects can lead many roads and towns to be at the bottom of a lake.

There was an episode of the office where one of the characters drives his car into a lake, because his GPS told him so, a clip can be found here.

The linked article doesn’t take into account error with the GPS itself.  GPS error is very common, especially in areas where the signal can reflect or be distorted.  A popular example of this can happen in an Urban Canyon.  I have seen a GPS estimate its location as being on a major highway, when a vehicle was traveling on a frontage road, as well as some very peculiar effects biking through New York City.

While not as readable as a USA Today article, Wikipedia has a very good article up on errors in GPS reception.

Caution: GPS devices aren’t always right. (via USA Today)

Microsoft Single View merging Business Data and Maps

Tuesday, March 3rd, 2009

It looks like even Microsoft is picking up on the current momentum of Neogeography.  This product seems to be pretty similar to its already existing MapPoint software, which is targeted at marketing and business uses, as well as some low-end GIS uses.  Microsoft’s Single View Platform is targeted more to goverment applications.  Microsoft has partnered with IDV Solutions to make this application, so I expect some decent results.

According to a write-up about the Single View session, SVP is designed to provide users with “a single, geographic view of complex information and data sets across multiple roles, locations, and user interfaces.”

I’m curious to see how this affects the government GIS applications market.
Maps + business data = Microsoft Single View. (via zdnet microsoft blog)

Scribd: A Great Place to Upload and Serve your PDFs

Thursday, February 26th, 2009

Those of you who talk to me on a regular basis know that I love touting Scribd as the best new document sharing service.  They have a service called iPaper that lets you embed your documents anywhere.

I love Scribd for sharing documents that would otherwise sit on my hard drive unused.  By serving up documents that I created, I am able to share information with people and hopefully reduce the amount of research that people need to do.

On example of a document I uploaded is below.  I created a Powerpoint presentation for GIS day 2008 to help a group of students understand how Google Maps works with external data.  After the presentation, the document would just sit on my hard drive.  So I decided to upload it to Scribd to help out the growing GIS community on Scribd.

[scribd id=9277394 key=key-1iuq59vhfcl78g0kh3b4]

Anyway, Scribd was nice enough to send me an Amazon.com gift card, so I feel I should officially promote them.  I don’t work for them or expect to be getting any more money, but I will definitely continue to use their service!