Azure Maps fuzzy search results are not limited to bounding box - azure-maps

When I perform a fuzzy search using the Azure Maps REST API, the results are not limited to the bounding box I specify. This makes searching for partial addresses much less useful, since many/most/all of the results are from other states and the relevant results from the specified state are not included in the first 10-20 results.
For example, if I search for "123 Main" and specify a bounding box that covers the state of Louisiana, I should get a half dozen or so point addresses in the results, and all the results should be constrained to the bounding box. (There may be a few results from the edges of surrounding states since the bounding box is a rectangle.) Instead, I get results from Connecticut, Ohio, Massachusetts, and so on that are clearly outside the bounding box.
The documentation clearly states, "You can use the btmRight and topleft parameters to set the bounding box. These parameters restrict the search to a specific area on the map."
https://learn.microsoft.com/en-us/azure/azure-maps/how-to-use-best-practices-for-search#limit-search-results
https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-fuzzy
The test query I am using is:
https://atlas.microsoft.com/search/fuzzy/json?subscription-key=[SUBSCRIPTION_KEY]&api-version=1.0&query=123+Main&countrySet=US&idxSet=Addr,PAD,POI,XStr&lat=30.3618&limit=20&lon=-91.1067&typeahead=true&topLeft=33.019457,-94.043147&btmRight=28.928609,-88.817017
Am I doing something wrong? How do I limit the search results to the bounding box?

The bounding box is meant to help influence the relevance of the results and is not a filter.

Related

Accessing or omitting non-existing data

I'm performing some geographical computations in a grid with squares (i.e. regions). I'm using Delphi, but the logic could probably be applied to C++ too. Let me first explain what I want to do.
The following image is a portion of my grid, which is represented by a two-dimensional array Square that denotes the centre point in each square, and the "movement through the layers":
The green square has an X and Y coordinate of 2, so that is Square[2,2]. The actual coordinates are stored in Square[2,2].Latitude and Square[2,2].Longitude as wel as extra information in e.g. Square[2,2].Info that I use for computations.
Now comes the purpose: I need to do some computations on the surrounding areas. How many of the surrounding areas can be called "neighbours", depends on how many "layers" I have defined. In the image above, I used two of these "layers". That means that when starting from the green cell, I go around it once (blue arrows) and then again in the second layer (red arrows).
Now comes the problem: if I would have started in Square[1,1] (green square) instead of Square[2,2] as in the image below, the second layer (in red) would try to access data on the left side and at the bottom that does not exist (i.e. in the "-1" column and row). See the image below. This problem occurs at all borders of course.
I probably can make exceptions with IF-statements for every scenario, but I was wondering if there are common programming "tricks" that can handle such situations where you try to access data does not exist.
For example, I imagine it would be very handy if I can follow the pattern of the arrows depicted in the first image to access all the neighbouring squares every single time, even if there are non-existing squares. So, looking at the first image, after Square[3,0] you'd go to something like Square[3,-1] etc. and then eventually come back into the "feasible" zone in Square[0,3].
To visit neighborhood, you can use some kind of BFS (breadth-first search).
But for sparse structure (like the last picture shows) it is worth to use some data structure to organize cells in a good way. Perhaps kd-tree is suitable - you add all existing cells in the tree and make range search around given cell to get other cells in its vicinity.
Also look at another spatial data structures (see list at the bottom of kd-tree page).

Display percentage value as a fill in a custom shape

I'm looking at some new options for displaying a percentage value as a fill in a custom shape. Consider the effect to be similar to a "progress thermometer" in a traditional dashboard UI sense.
Considerations
Goal - a graphic element showing a percentage value for a custom report.
Format - Either a full graphic (or infographic) itself, or part of a PDF via Photoshop/InDesign or even iBooks (as an excuse to use it).
Usage - I'd like the process to be programmatic, for re-use. It needs to be accurate, and I'd like the solution to be somewhat object oriented to apply to other datasets and graphical containers. This rules out hand-drawn charting.
Source data - currently a pivot table in Excel, but I can work with any other host as required.
Shape - is a custom vector shape that will originate from Illustrator/Inkscape. final format as best fits resolution and rendering of the report. I would also be interested in any other generative shape ideas (such as java/javascript).
Fill - I'd like to be able to represent the fill as both an actual percentage of total area (true up), and as a percentage of the vertical scale. I'd imagine this flexibility would also help reuse of the method as a fill value against selected object variables (height, area, whatever).
I know I'm being slightly vague in the programming languages or hosts side of things, but this gives me an opportunity to break out of the usual analytic toolchain and scope out some innovative or new solutions. I'm specifically interested in open source solutions, but I'm very keen to review other current methods you might suggest.
This might be a little open ended for you, but d3.js is very powerful. There might be some useful templates on the site, or you can build your own from the library.
If you limit yourself to shapes where the percentage can be easily converted into a new shape by varying one of the dimensions, then the display part can be covered by creating a second shape based on the first one, and filling in 100% of the second shape.
This obviously works best with simple shapes like squares, rectangles, circles, etc, where it is simple to convert "50% of the area" or "75% of the height" into manipulation of vector nodes.
However, things gets significantly more difficult if you want to support genuinely arbitrary custom shapes. One way to handle that would be to break up a complex "progress bar" into "progress pieces" (e.g. a thermometer bulb that represents 10% of total progress, then a simple bar for the remaining 90%).
As has been mentioned, D3 seems like it would meet your needs - here are some simple examples of what I think you are asking:
Changing the fill color of a distinct shape: http://jsfiddle.net/jsl6906/YCMb8/
Changing the 'fill amount' of a simple shape: http://jsfiddle.net/jsl6906/YCMb8/1/

Show two polygons (wrap them) at low zoom, when showing more than one complete earth

How can I wrap shapes around the world, so that a shape is shown more than once at low zoom?
Example:
I draw a polygon over USA.
I zoom out so that I can see two USA's.
I only see one polygon: ( I want to see two!
The map data effectively has 2 USAs. That implies you should actually want 2 polygons, one of which will be hidden most of the time.
Might as well cater for the worst case and treat a single USA as the exception rather than the rule.
You can't.
As others have already pointed out, the fact that, at far zoom levels certain features get repeated on either side of the map is an unwanted but inevitable side-effect of a projected surface that enables continuous scrolling. This has only been an issue in recent versions of the Bing Maps control - the earlier v6.x control prevented the map from panning across the 180th meridian.
I cannot think of any possible reason why you'd ever want to show two USAs, let alone target data to be positioned on each one. So the solution is to modify either the zoom level at which the map is displayed, or the size of the application window in which it is being displayed so that this situation doesn't occur.

Problem in Shapefiles

i need a help
i have a shape file that continue 3716 polygon record and want to draw this shape file where some of those polygons need to have a specified color
OR WANT a search technique to search this map for a point (lat-long) and get it's belong polygon but not by searching all polygons
i tries all, OpenJump-Source code, GeoTools,....
In GeoTools you can follow the Style tutorial to show you how to display your shapefile. There is no way to carry out a point in polygon search without at least examining the bounding box of each polygon but the GeoTools Query Lab will talk you through the basics of setting up a query (and if your shapefile has a spatial index then it will be quick enough).

Bounding Box Search in JDO and GAE

i have my current lat,lon
and i want to make Bounding Box Search in GAE data store to get every nearest location to my current point .
i want the bounding box to be 1 km around my point
how can i do this ??
Check this example: http://code.google.com/appengine/articles/geosearch.html
It is in Python, but the discussion of the associated problems and ways to implement precomputed boxes could be helpful to you.

Resources