<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple shapefile drawing in ActionScript 3</title>
	<atom:link href="http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/</link>
	<description>Adventures in maps, cartography, visualization, and Flash</description>
	<lastBuildDate>Mon, 08 Mar 2010 22:01:14 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Markus Wagner</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12935</link>
		<dc:creator>Markus Wagner</dc:creator>
		<pubDate>Mon, 08 Feb 2010 06:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12935</guid>
		<description>Thx a lot Andy !</description>
		<content:encoded><![CDATA[<p>Thx a lot Andy !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Woodruff</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12694</link>
		<dc:creator>Andy Woodruff</dc:creator>
		<pubDate>Fri, 05 Feb 2010 15:01:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12694</guid>
		<description>Markus, are you working with Flex Builder? If so, you can simply test this example by creating a new ActionScript project, naming it ShapefileExample, and copying the contents of the zip file here into the src folder. That would allow you to publish the ShapefileExample.as class, and hopefully you can go from there to include this code in your existing project. You would want to copy or import the classes to your project, and look at ShapefileExample for an example of how to use them.</description>
		<content:encoded><![CDATA[<p>Markus, are you working with Flex Builder? If so, you can simply test this example by creating a new ActionScript project, naming it ShapefileExample, and copying the contents of the zip file here into the src folder. That would allow you to publish the ShapefileExample.as class, and hopefully you can go from there to include this code in your existing project. You would want to copy or import the classes to your project, and look at ShapefileExample for an example of how to use them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharedtut</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12549</link>
		<dc:creator>Sharedtut</dc:creator>
		<pubDate>Wed, 03 Feb 2010 16:46:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12549</guid>
		<description>Good tutorial, thank you for sharing.</description>
		<content:encoded><![CDATA[<p>Good tutorial, thank you for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus Wagner</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12539</link>
		<dc:creator>Markus Wagner</dc:creator>
		<pubDate>Wed, 03 Feb 2010 13:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12539</guid>
		<description>Hi, i´m actually working at a same problem. Including shapefiles into an existing flex3 project.

Can someone show me the way, how to include this example into my project? I have no idea how to display this example or how to test it. Thank you</description>
		<content:encoded><![CDATA[<p>Hi, i´m actually working at a same problem. Including shapefiles into an existing flex3 project.</p>
<p>Can someone show me the way, how to include this example into my project? I have no idea how to display this example or how to test it. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Woodruff</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12292</link>
		<dc:creator>Andy Woodruff</dc:creator>
		<pubDate>Sat, 30 Jan 2010 18:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12292</guid>
		<description>Jeremy,

I haven&#039;t tried projected shapefiles with this particular code, but with similar classes in other projects I have indeed noticed problems, usually with the shapes not showing up at all. Maybe it has something to do with the crazy large or small numbers that the coordinates turn out to be? In my ShpFeature class there is a scaleFactor variable; my only suggestion at the moment is to try fiddling with that to see if it makes a difference. That number multiplies the coordinates and perhaps can bring the numbers into some range that Flash is happy with, if that even is the problem.</description>
		<content:encoded><![CDATA[<p>Jeremy,</p>
<p>I haven&#8217;t tried projected shapefiles with this particular code, but with similar classes in other projects I have indeed noticed problems, usually with the shapes not showing up at all. Maybe it has something to do with the crazy large or small numbers that the coordinates turn out to be? In my ShpFeature class there is a scaleFactor variable; my only suggestion at the moment is to try fiddling with that to see if it makes a difference. That number multiplies the coordinates and perhaps can bring the numbers into some range that Flash is happy with, if that even is the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Usher</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-12288</link>
		<dc:creator>Jeremy Usher</dc:creator>
		<pubDate>Sat, 30 Jan 2010 17:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-12288</guid>
		<description>Hi Andy, 

Many thanks for these classes, they are a tremendous help. To avoid reprojecting to Albers point-by-point in AS3, I first reprojected your States shapefile using MapWindow (I also tried QGIS). The projection works and will draw correctly on Matt Bloch&#039;s MapShaper, but comes out garbled (or sometimes not at all) when I try to use your classes. Have you seen anything like this? Any help would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Hi Andy, </p>
<p>Many thanks for these classes, they are a tremendous help. To avoid reprojecting to Albers point-by-point in AS3, I first reprojected your States shapefile using MapWindow (I also tried QGIS). The projection works and will draw correctly on Matt Bloch&#8217;s MapShaper, but comes out garbled (or sometimes not at all) when I try to use your classes. Have you seen anything like this? Any help would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Woodruff</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-8869</link>
		<dc:creator>Andy Woodruff</dc:creator>
		<pubDate>Tue, 17 Nov 2009 15:07:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-8869</guid>
		<description>Alycia,

Without bothering just yet to look at the code to remind myself, I believe what&#039;s going on is that in the code I posted, every shape actually is at (0,0) but the graphics are drawn within that shape at wherever the coordinates actually are. In other words, the x/y origin of the movie clip is not at the upper left corner of the shape but rather always at (0,0). This was done for some convenience (or perhaps laziness) in creating the shapes. You should be able to worth with the getBounds() method of a movie clip to get its actual coordinates and go from there.

But I may be a) misinterpreting your problem and/or b) misremembering the code. Will look over it when I get a chance!</description>
		<content:encoded><![CDATA[<p>Alycia,</p>
<p>Without bothering just yet to look at the code to remind myself, I believe what&#8217;s going on is that in the code I posted, every shape actually is at (0,0) but the graphics are drawn within that shape at wherever the coordinates actually are. In other words, the x/y origin of the movie clip is not at the upper left corner of the shape but rather always at (0,0). This was done for some convenience (or perhaps laziness) in creating the shapes. You should be able to worth with the getBounds() method of a movie clip to get its actual coordinates and go from there.</p>
<p>But I may be a) misinterpreting your problem and/or b) misremembering the code. Will look over it when I get a chance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alycia</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-8846</link>
		<dc:creator>Alycia</dc:creator>
		<pubDate>Mon, 16 Nov 2009 18:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-8846</guid>
		<description>First of all, thank you for posting this code. Being able to read shape files into Flash is preventing me from having to switch to Silverlight. I am trying to do something REALLY simple with all of this, import the shape file and dbf into Flash, create a movie clip for each County and give it a name. Importing the shapes and data wasn&#039;t a problem, but as soon as I made them into movie clips it set the x and y coordinates to 0. Can anyone help me out?

Thanks!</description>
		<content:encoded><![CDATA[<p>First of all, thank you for posting this code. Being able to read shape files into Flash is preventing me from having to switch to Silverlight. I am trying to do something REALLY simple with all of this, import the shape file and dbf into Flash, create a movie clip for each County and give it a name. Importing the shapes and data wasn&#8217;t a problem, but as soon as I made them into movie clips it set the x and y coordinates to 0. Can anyone help me out?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otory</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-6793</link>
		<dc:creator>Otory</dc:creator>
		<pubDate>Tue, 08 Sep 2009 05:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-6793</guid>
		<description>Just Hopped In To Say Biggest Thanks :)

This Stuff Helped Me Alot.

Thankie ;)</description>
		<content:encoded><![CDATA[<p>Just Hopped In To Say Biggest Thanks <img src='http://www.cartogrammar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This Stuff Helped Me Alot.</p>
<p>Thankie <img src='http://www.cartogrammar.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Corey</title>
		<link>http://www.cartogrammar.com/blog/simple-shapefile-drawing-in-actionscript-3/comment-page-1/#comment-6488</link>
		<dc:creator>Michael Corey</dc:creator>
		<pubDate>Fri, 31 Jul 2009 21:23:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cartogrammar.com/blog/?p=235#comment-6488</guid>
		<description>Yep, I finally cracked it this afternoon. As you say, the projection was necessary, but then getting the boundaries for the rectangular Google Maps overlay from the bounding box of the newly projected coordinates was bad.

The scale factor weirdness I was getting was due to the loss of precision inherent in getBounds();. When I collected them earlier in the process, before the Mercator conversion and scaling down, it&#039;s precise.

Thanks again, I&#039;m sure I will be using this quite a bit.</description>
		<content:encoded><![CDATA[<p>Yep, I finally cracked it this afternoon. As you say, the projection was necessary, but then getting the boundaries for the rectangular Google Maps overlay from the bounding box of the newly projected coordinates was bad.</p>
<p>The scale factor weirdness I was getting was due to the loss of precision inherent in getBounds();. When I collected them earlier in the process, before the Mercator conversion and scaling down, it&#8217;s precise.</p>
<p>Thanks again, I&#8217;m sure I will be using this quite a bit.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
