Code Monkey home page Code Monkey logo

bingmapssdstoolkit's Introduction

Bing Maps Logo

NuGet license

Bing Maps Spatial Data Services (SDS) Toolkit for .NET

This is a portable .NET class library which provides a set of tools that make it easy to access the Bing Maps Spatial Data Services in .NET based apps. The Bing Maps Spatial Data Services provides the following key functionalities:

  • Batch forward and reverse Geocoding of up to 200,000 rows of data in a single request.
  • Spatial data hosting and services: Upload a two dimensional table of data as a data source and expose it as a spatial REST service.
    • Perform spatial queries against data sources using:
      • Find Nearby (radial)
      • Find in bounding box
      • Find by Property
      • Find along a route
      • Intersection search (i.e. search within a custom shape.)
  • Public Data sources: Access public data sources that contain information such as points of interest and census data.
  • Boundary Data: Access to administrative boundary data via the Geodata API. Boundary data types available vary from country to country. Supported boundary types; zip/postal codes, neighborhoods, cities, counties, states/provinces, countries, and continents.

See the documentation for more information on how to use this library. This toolkit is based on the documentation for the Bing Maps Spatial Data Services.

If you are working with the Bing Maps REST services which provides; on-demand forward and reverse geocoding, routing, static imagery, traffic and elevation data, take a look at the Bing Maps REST Toolkit.

Dependancy: Microsoft.Bcl.Compression

NuGet Package

The Bing Maps Spatial Data Services Toolkit is available as a NuGet package. If using Visual Studio, open the nuget package manager, select the Browse tab and search for "Bing Maps SDS". This should reduce the list of results enough to find the "BingMapsSDSToolkit" package. The owner of the package is bingmaps and the author is Microsoft.

Alternatively, if you are using the nuget command line:

PM> Install-Package BingMapsSDSToolkit

Supported Platforms

  • .NET Framework 4.5+
  • .NET Standard 2.0
  • Universal Windows Platform (UWP)
  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows Phone 10
  • Windows Phone 8.1
  • Xamarin.Android
  • Xamarin.iOS
  • Xamarin.iOS (Classic)

Features

Data Source API:

  • Easily geocode and upload a data source with just a few lines of code.
  • Automatically compresses data before uploading.
  • Supports uploading of delimited (pipe, tab, comma), XML (as per SDS schema), KML, KMZ and SHP files. Can read compressed file streams such as zipped files containing one of these files.
  • Local Data Source validation. Reduces the number of invalid data sources that are uploaded, thus reduce the number of wasted SDS jobs that are created.
  • Better support for delimited files.
    • Schema text not required.
    • Handles quoted column header values.
    • Handles extra delimiters in schema text line.
  • Wraps 99% of functionalities (no support for downloading the data schema of a data source as it isn't needed by this library).

Geocode Data Flow API:

  • Easily forward or reverse geocode up to 200,000 entities in a single request.
  • Combines like addresses as a single request. This allows rows with the same addresses to only create a single row in the geocode process. This helps to maximize the 1M free batch geocode limit.

Geodata API:

  • Easily access the boundary data from the GeoData API and search for zip/postal codes, neighborhoods, cities, counties, states/provinces, countries, and continent boundaries.
  • Provides compression tools for handling the encoded polygon data.

Query API:

  • Classes for easily creating queries for a data source.
  • Parses response from any data source into a common QueryResult object.
  • Support for multiple distance units (km, miles, feet, meters, yards)
  • Support for filters.
  • Handles encoding filter values, and escapes single quotes by using the OData convention of using two single quotes side by side.

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

TODO List

The following is a list of tasks or ideas to do on this project.

  • Add support for XLSX.
  • Get culture for geocoding from country property
  • Option to download existing data source when geocoding, pull coordinates of already geocoded rows if address and id have not changed.

Related Projects

Additional Resources

License

MIT

See License for full license text.

bingmapssdstoolkit's People

Contributors

chamons avatar cschotte avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar rbrundritt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bingmapssdstoolkit's Issues

Netstandard2 Support

It would be great to have Netstandard2 support (See #2) instead of a a handful of supported platforms.

Not compatible with latest Xamarin.iOS due to Microsoft.Bcl.Build dependency?

When attempting to use BingMapsSDSToolkit.1.0.3 with Xamarin.iOS, I get this nuget error:

Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Steps to reproduce:

It does work with Xamarin.Mac Full profile but does not work with Modern for the same exact reason.

Missing POI data in SDS public data sources

Hi there,

I have been exploring this SDS API since it can list the x closest entities from a given geopoint. I'm particularly interested in looking for grocery store entities from the NAVTEQNA data source (https://msdn.microsoft.com/en-us/library/hh478192.aspx). However, it seems that some stores are not available in this database. For instance, in Canada there is a chain of stores called "Real Canadian Superstore". This is not found in the database when using the following query

http://spatial.virtualearth.net/REST/v1/data/f22876ec257b474b82fe2ffcb8393150/NavteqNA/NavteqPOIs?spatialFilter=nearby({my location})&$filter=EntityTypeID%20eq%20'5400'&$select=EntityID,DisplayName,Latitude,Longitude,__Distance,AddressLine,Locality,CountryRegion&$top=6&key={bingMapsKey}

How would one go about getting the NAVTEQNA data source updated with new entity data?

Cheers,
Daniel

[GeoDataAPI-GeoDataResults]Bug when parsing bestViewBox in .\Source\GeoDataAPI\Models\GeoDataResult.cs

When I tried to get the best view of polygons, I found that the source has a small bug when getting the best view box by parsing the EntityMetadata.BestMapViewBox. As the GeoDataApi Doc says, the BestMapViewBox is provided in the format of a MULTIPOINT ((WestLongitude SouthLatitude), (EastLongitude NorthLatitude)). But the when the code try to parse the string and get the north west coordinate and south east coordinate, it uses the wrong data with the index. Some fix should be like
image

GetBoundary fails when CurrentCulture.NumberFormat.NumberDecimalSeparator is not "."

In GeoManager.cs, the latitude and longitude strings are not correctly rendered if CurrentCulture is for example IT (Italian) such that the decimal separator is "," rather than ".".

One workaround is to set the separator to "." before calling GetBoundary(), and set it back after if necessary.

Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
List<GeodataResult> results = await GeodataManager.GetBoundary(request, bingMapsKey);

Unable to delete an entity in Bing spatial data service data source using __deleteEntity in the xml schema

Repro steps:

  1. Create a data source on Bing spatial data services (SDS) and add few entities
  2. Create an xml file similar to following to delete an entity
<MainRoot>
  <xs:schema id="shopsBingSDSDataSource_dev" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="shopsBingSDSDataSource_dev" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Shop">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="shopId" type="xs:string" />
                <xs:element name="shopLocation" msdata:DataType="Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" type="xs:anyType" minOccurs="0" />
                <xs:element name="__deleteEntity" type="xs:boolean" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
      <xs:unique name="Constraint1" msdata:PrimaryKey="true">
        <xs:selector xpath=".//Shop" />
        <xs:field xpath="shopId" />
      </xs:unique>
    </xs:element>
  </xs:schema>  
  <Offering>
    <shopId>8df24e6f-d877-45bd-9256-bc9933d1b154</shopId>
	<shopLocation>POINT (0 0)</shopLocation>    
	<__deleteEntity>true</__deleteEntity>
  </Offering>
</MainRoot>```

3. Use the below method from the toolkit to upload a job (Create a console application to test this. Take reference to the Bing SDS toolkit source code project)
`public async Task<DataflowJob> Upload(DataSource dataSource, LoadOperation loadOperation, bool setPublic, bool skipEmptyLocations)`

Expected: Job on Bing SDS should get created

Actual result: Exception thrown at Line 1440 in Datasource.cs
`var deleteInfo = (string)row[deleteIdx];`

Possible Solution: Use ToString() in above code as follows. This did not give me exception.
`var deleteInfo = row[deleteIdx].ToString();`


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.