On Mar 8, 7:01 am, Drew <[email protected]> wrote:
> Hi Ben,
>
> Thanks for the reply. So from what you've said (as I see it),
> I don't have to do anything, as google maps will take care of it
> all! :-)
>
> The data I got the the US Dept. of Interior, has approx 6000
> counties in the US + 50 states + 1 country. We may be
> implementing intermediary regions between those levels as
> well, but would add no more than 1000 on a rough guess,
> so in the order of 7000 total.
I am curious where you obtained your shape files. The U.S. Census
Department shape files contain fewer than 4000 U.S. counties /
parishes / burroughs.
> I've been working on an algorithm simplifying the US border data
> I have (approx 71,000 points) as I'd like to get the size down to
> no more than 1500 points for the US and say 50-150 per county
> (absolute tops).
Forget about Douglas-Peucker. It was designed for polylines, not for
polygons. It will leave you with poorly fitting polys with overlaps
and gaps. Imagine the use of sandpaper on the pieces of a jigsaw
puzzle. Douglas-Peucker is asymmetric. It produces different results
depending on the direction of the scan. The common boundaries between
adjacent counties will not fit together tightly.
Your best bet is to factor out the common boundaries. It will reduce
the size of your file by half. Apply point reduction to the common
boundaries. Reassemble the pieces into complete polys in the
browser. It is extra work for the browser but the transmission delay
is cut in half.
If you decide to use compression, use a bi-directional algorithm.
Each poly segment has to be used twice, once per direction. The API
encoding is uni-directional. It cannot unpack in reverse.
> The user will have the option to turn regions on and off, so
> potentially
> all counties, and all states, could be visible on the map at once,
> but that would be a rare occurrence, and probably not something
> I will worry about.
If you discover the API cannot display hundreds of complex polys
simultaneously, look at :
http://www.polyarc.us
It is obfuscated to discourage tampering. The API is also.
Documentation will appear soon.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.