Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Thu, 8 May 2008 10:54:08 -0700,    group: microsoft.public.mappoint.webservice        back       


us zip code border   
We are searching a map solution which allows to draw the US map whith the 5 
digit zip code border (to create a  custom application for a US financial 
company). The problem is I cannot find a way to do it in MapPoint.
I tried to get the PostCode1 entities from MapPoint.NA and to draw them as 
Polygons, but it gives me the Exception "The specified DataSource object 
either does not exist, is not a Polygon datasource, or you are not authorized 
to use it. Argument: specification.Polygon[0].DataSourceName". 
Do you know a way to draw the zip codes border, or why is this not working?
Here is the code:
 FindSpecification findZipCodes  = new FindSpecification();
            findZipCodes.DataSourceName = "MapPoint.NA";
            findZipCodes.InputPlace = "1";
            findZipCodes.Options = new FindOptions();
            findZipCodes.Options.ThresholdScore = 0;
            findZipCodes.EntityTypeNames = new string[] { "Postcode1" };
            findZipCodes.Options.Range = new FindRange();
            findZipCodes.Options.Range.StartIndex = 0;
            findZipCodes.Options.Range.Count = 50;

            FindResults foundZips;
            foundZips = _mapPointServices.Finder.Find(findZipCodes);
            Polygon[] zipPoly = new Polygon[foundZips.Results.Length];
            ElementColor color = new ElementColor();
            for (int i = 0; i < foundZips.Results.Length; i++)
            {
                Polygon poly = new Polygon();
                poly.DataSourceName = 
foundZips.Results[i].FoundLocation.DataSourceName;
                poly.EntityID = foundZips.Results[i].FoundLocation.Entity.ID;
                poly.BorderColor = color;
                poly.FillColor = color;
                zipPoly[i] = poly;
            }
            FindSpecification findSpec = new FindSpecification();
            findSpec.DataSourceName = "MapPoint.NA";
            findSpec.InputPlace = "1, CA";

            FindResults foundResults = 
_mapPointServices.Finder.Find(findSpec);

            // Set up a MapOptions object.
            MapOptions mo = new MapOptions();
            mo.Format = new ImageFormat();
            mo.Format.MimeType = "image/jpeg";
            mo.Format.Height = height;
            mo.Format.Width = width;
            mo.ReturnType = MapReturnType.ReturnImage;
            mo.Style = MapStyle.Political;

            ViewByScale[] viewByScale = new ViewByScale[1];
            viewByScale[0] = new ViewByScale();
            viewByScale[0].CenterPoint = 
foundResults.Results[0].FoundLocation.LatLong;
            viewByScale[0].MapScale = scale;

            // Set up a MapSpecification object.
            MapSpecification spec = new MapSpecification();
            spec.DataSourceName = "MapPoint.NA";
            spec.Views = viewByScale;
            spec.Options = mo;
            spec.Polygons = zipPoly;

            MapImage[] mi = _mapPointServices.Render.GetMap(spec);

            return new Bitmap(new 
System.IO.MemoryStream(mi[0].MimeData.Bits));
date: Thu, 8 May 2008 10:54:08 -0700   author:   elven_cris

RE: us zip code border   
Come on peoples, nobody has nothing to say??? =)) 
I am searching for over a week a control which can display the us zip codes 
border, and I haven't reached a solution. Am I the only one to do such a 
thing? It is too obvios and nobody bothers??? Please give me an idea, 
something to work with. Please!!!

"elven_cris" wrote:

> We are searching a map solution which allows to draw the US map whith the 5 
> digit zip code border (to create a  custom application for a US financial 
> company). The problem is I cannot find a way to do it in MapPoint.
> I tried to get the PostCode1 entities from MapPoint.NA and to draw them as 
> Polygons, but it gives me the Exception "The specified DataSource object 
> either does not exist, is not a Polygon datasource, or you are not authorized 
> to use it. Argument: specification.Polygon[0].DataSourceName". 
> Do you know a way to draw the zip codes border, or why is this not working?
> Here is the code:
>  FindSpecification findZipCodes  = new FindSpecification();
>             findZipCodes.DataSourceName = "MapPoint.NA";
>             findZipCodes.InputPlace = "1";
>             findZipCodes.Options = new FindOptions();
>             findZipCodes.Options.ThresholdScore = 0;
>             findZipCodes.EntityTypeNames = new string[] { "Postcode1" };
>             findZipCodes.Options.Range = new FindRange();
>             findZipCodes.Options.Range.StartIndex = 0;
>             findZipCodes.Options.Range.Count = 50;
> 
>             FindResults foundZips;
>             foundZips = _mapPointServices.Finder.Find(findZipCodes);
>             Polygon[] zipPoly = new Polygon[foundZips.Results.Length];
>             ElementColor color = new ElementColor();
>             for (int i = 0; i < foundZips.Results.Length; i++)
>             {
>                 Polygon poly = new Polygon();
>                 poly.DataSourceName = 
> foundZips.Results[i].FoundLocation.DataSourceName;
>                 poly.EntityID = foundZips.Results[i].FoundLocation.Entity.ID;
>                 poly.BorderColor = color;
>                 poly.FillColor = color;
>                 zipPoly[i] = poly;
>             }
>             FindSpecification findSpec = new FindSpecification();
>             findSpec.DataSourceName = "MapPoint.NA";
>             findSpec.InputPlace = "1, CA";
> 
>             FindResults foundResults = 
> _mapPointServices.Finder.Find(findSpec);
> 
>             // Set up a MapOptions object.
>             MapOptions mo = new MapOptions();
>             mo.Format = new ImageFormat();
>             mo.Format.MimeType = "image/jpeg";
>             mo.Format.Height = height;
>             mo.Format.Width = width;
>             mo.ReturnType = MapReturnType.ReturnImage;
>             mo.Style = MapStyle.Political;
> 
>             ViewByScale[] viewByScale = new ViewByScale[1];
>             viewByScale[0] = new ViewByScale();
>             viewByScale[0].CenterPoint = 
> foundResults.Results[0].FoundLocation.LatLong;
>             viewByScale[0].MapScale = scale;
> 
>             // Set up a MapSpecification object.
>             MapSpecification spec = new MapSpecification();
>             spec.DataSourceName = "MapPoint.NA";
>             spec.Views = viewByScale;
>             spec.Options = mo;
>             spec.Polygons = zipPoly;
> 
>             MapImage[] mi = _mapPointServices.Render.GetMap(spec);
> 
>             return new Bitmap(new 
> System.IO.MemoryStream(mi[0].MimeData.Bits));
> 
> 
> 
>
date: Thu, 8 May 2008 17:20:01 -0700   author:   elven_cris

RE: us zip code border   
Hi,

The boundary data you are looking for is not available through MWS.  You'd 
have to purchase some third party polygon data containing zip boundaries, 
upload it as a polygon datasource, then display it through your app.  You 
might want to check out a Virtual Earth solution to this at: 
http://mattberseth.com/blog/2007/05/plotting_zipcode_boundaries_us.html

Regards,
-- 
Infusion Development
http://www.infusion.com


"elven_cris" wrote:

> Come on peoples, nobody has nothing to say??? =)) 
> I am searching for over a week a control which can display the us zip codes 
> border, and I haven't reached a solution. Am I the only one to do such a 
> thing? It is too obvios and nobody bothers??? Please give me an idea, 
> something to work with. Please!!!
> 
> "elven_cris" wrote:
> 
> > We are searching a map solution which allows to draw the US map whith the 5 
> > digit zip code border (to create a  custom application for a US financial 
> > company). The problem is I cannot find a way to do it in MapPoint.
> > I tried to get the PostCode1 entities from MapPoint.NA and to draw them as 
> > Polygons, but it gives me the Exception "The specified DataSource object 
> > either does not exist, is not a Polygon datasource, or you are not authorized 
> > to use it. Argument: specification.Polygon[0].DataSourceName". 
> > Do you know a way to draw the zip codes border, or why is this not working?
> > Here is the code:
> >  FindSpecification findZipCodes  = new FindSpecification();
> >             findZipCodes.DataSourceName = "MapPoint.NA";
> >             findZipCodes.InputPlace = "1";
> >             findZipCodes.Options = new FindOptions();
> >             findZipCodes.Options.ThresholdScore = 0;
> >             findZipCodes.EntityTypeNames = new string[] { "Postcode1" };
> >             findZipCodes.Options.Range = new FindRange();
> >             findZipCodes.Options.Range.StartIndex = 0;
> >             findZipCodes.Options.Range.Count = 50;
> > 
> >             FindResults foundZips;
> >             foundZips = _mapPointServices.Finder.Find(findZipCodes);
> >             Polygon[] zipPoly = new Polygon[foundZips.Results.Length];
> >             ElementColor color = new ElementColor();
> >             for (int i = 0; i < foundZips.Results.Length; i++)
> >             {
> >                 Polygon poly = new Polygon();
> >                 poly.DataSourceName = 
> > foundZips.Results[i].FoundLocation.DataSourceName;
> >                 poly.EntityID = foundZips.Results[i].FoundLocation.Entity.ID;
> >                 poly.BorderColor = color;
> >                 poly.FillColor = color;
> >                 zipPoly[i] = poly;
> >             }
> >             FindSpecification findSpec = new FindSpecification();
> >             findSpec.DataSourceName = "MapPoint.NA";
> >             findSpec.InputPlace = "1, CA";
> > 
> >             FindResults foundResults = 
> > _mapPointServices.Finder.Find(findSpec);
> > 
> >             // Set up a MapOptions object.
> >             MapOptions mo = new MapOptions();
> >             mo.Format = new ImageFormat();
> >             mo.Format.MimeType = "image/jpeg";
> >             mo.Format.Height = height;
> >             mo.Format.Width = width;
> >             mo.ReturnType = MapReturnType.ReturnImage;
> >             mo.Style = MapStyle.Political;
> > 
> >             ViewByScale[] viewByScale = new ViewByScale[1];
> >             viewByScale[0] = new ViewByScale();
> >             viewByScale[0].CenterPoint = 
> > foundResults.Results[0].FoundLocation.LatLong;
> >             viewByScale[0].MapScale = scale;
> > 
> >             // Set up a MapSpecification object.
> >             MapSpecification spec = new MapSpecification();
> >             spec.DataSourceName = "MapPoint.NA";
> >             spec.Views = viewByScale;
> >             spec.Options = mo;
> >             spec.Polygons = zipPoly;
> > 
> >             MapImage[] mi = _mapPointServices.Render.GetMap(spec);
> > 
> >             return new Bitmap(new 
> > System.IO.MemoryStream(mi[0].MimeData.Bits));
> > 
> > 
> > 
> >
date: Fri, 9 May 2008 06:58:00 -0700   author:   Derek Chan

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us