How can I plot a point of an address on a map?
I want to basically use VEMap.Find(), but simply get the coordinates of the location.
When you call Find(), pass in true for the showResults parameter. The Microsoft doc has an example of how to do this: Microsoft's VEMap.Find() documentation
If you really only want the lat/long of a result returned from VEMap.Find(), check out this blog post: Getting Coordinates from VEMap.Find(). The coordinates are accessible in the GetCoordinates function as properties of the findPlaceResults object.
Related
This question is about use of evas_object_image_data_set function. Say, I have some pixel array in RGBA format. I make a transformation on it to become ARGB, suitable for Evas Image Object. Next thing I create a window with elm_win_add. Then I create image object with evas_object_image_add(evas_object_evas_get(window)). After that I call to evas_object_image_fill_set, then evas_object_image_size_set. Then I call evas_object_image_data_set and finally I call evas_object_image_data_update_add with approriate region for my image. After all this done I see nothing but black box. Am I doing something wrong?
P.S.: using efl version 1.7.7
Setup the image object as described in the question.
Get a void pointer to the raw image data with evas_object_image_data_get, with EINA_TRUE in argument for_writing.
Modify the data as needed.
Call evas_object_image_data_set with the void pointer as argument.
I'm working on a system that stores latitude/longitude information of addresses in a PostGIS table. To store Lat/Long in geometry data type I'm using ST_GeometryFromText function.
For example the following function call gets the geometric value against the specified Lat/Long position:
myPointGeo = ST_GeometryFromText('POINT(40.758871 -73.985114));
Similarly, I convert a Polygon into geometric representation as follows:
myPolygonGeo = ST_GeometryFromText('POLYGON ((40.7566484549725 -73.9878561496734, 40.7556894646734 -73.9853026866913, 40.7545841705587 -73.9860537052154, 40.7548036054111 -73.9881458282471, 40.7559820394514 -73.9887895584106, 40.7566484549725 -73.9878561496734 ))')
I want to find out whether the above lat/long position resides within this Polygon or not. For this I'm using ST_Within function. But though 'myPointGeo' actually resides within the Polygon, ST_Within is returning false. I'm using ST_Within this way:
St_Within(myPointGeo,myPolygonGeo)
What am I doing wrong here? Should I use some other function for this purpose?
The query looks correct. It returns false since the point is not in the polygon. The two geometries are disjoint.
I have a factory RGEO_FACTORY = RGeo::Geographic.simple_mercator_factory
And I have a point(POINT (28.97566007 41.01452809)), whose srid is 3785.
Then I get a new coordinate using RGEO_FACTORY.point(lon, lat).projection. And it's POINT (3225555.7243913896 5014484.790030423)
Now, I need to use the sql to query to improve the speed. Like this:"SELECT ST_AsText(ST_Transform(lat_lon, 4326)) from points WHERE points.id = 1" . I expect to get the same result as POINT (3225555.7243913896 5014484.790030423). But I can't get it.
And I have tried other srid to transform the coordinate of the point, but in vain.
What should I do to solve this?
Thanks in advance.
When you use RGeo::Geographic.simple_mercator_factory to create points, like you do with RGEO_FACTORY.point(lon, lat), their srid is predefined by the factory, and it's not 3785, it's 4326, see the docs for yourself. And these points' projection method returns points in 3785. Learn the actual srid of your lat_lon field with ST_SRID(lat_lon), if it's a geometry type, then figure out which srid you want to covert it to.
Covered that in more details answering another similar question.
I have an array of street addresses, I want my app to sort that array starting with the closest address to my location (GPS).
Now that Apple has released iOS Maps in iOS 6, what is the easier way to do that?
Thanks,
Matt.
Approach I'd take would be use CLGeocoder to obtain CLLocation instances for each address (there are several async methods provided by the class to do this). Save the values obtained if needed for future sorts to save having to re-obtain them. Get your location as a CLLocation instance. Use -[ CLLocation distanceFromLocation: ] to obtain distance between your device location and each address location. Sort on these distance values.
Hope this helps!
Mark
I am programming a basic GUI in MATLAB that utilizes the mapping toolbox. The GUI will display a grayscale image and then plot discrete points over the data, all of this over the necessary map projection. It is important that I plot onto map axes (those created by the axesm command) rather than the vanilla cartesian space. I have no problem doing all this from the command line, but I cannot find a way to implement a GUI version and its driving me nuts.
The problem is that I need to specify the map axes as being the child of the parent figure. The normal axes has a property that can be set, doing something like:
axesHandle = axes('Parent', parentHandle, ...);
or
set(axesHandle, 'Parent', parentHandle);
However, there is no equivalent parent property for the map axes created by the axesm function, so I have no way to manipulate the axes within the figure. How can I do this?
Update: If I create a plot within the map axes in an empty figure, get(figureHandle, 'Children') returns the handle of the axesm object (thanks #slayton!), so the map axes object must be implicitly added to the children of the figure by MATLAB.
Should I be concerned that the map axes do not refer back to the parent figure, or should I just let it be? I wonder if this is a classic case of MATLAB forcing me to not comply with the standards the manual tells me to implement.
From reading your question what I think you are trying to do is grab the handle of the axes object. This can be done as the axes is created using either axes or subplot
a = axes();
a = subplot(x,y,z);
% both return an handle to the newly created axes object
Additionally if the axes is created automagically by a function call like plot or image you can get the axes handle that too:
p = plot(1:10); %returns a handle to a line object
a = get(p,'Parent');
i = image(); %returns a handle to an image object
a = get(i, 'Parent');
Finally, neither of those two options is available you can always get the axes handle from its containing figure with:
a = get(figureHandle, 'Children');
Remember though that this will return a vector of axes handles if your figure contains more than one axes.
Finally when it comes time to draw draw your points to the axes that contains your map image you simply need to call:
line(xPoints, yPoints, 'linestyle', 'none', 'marker', '.', 'color', 'r', 'size', 15)
This will draw the vertices of the line using large red dots.
I'm not sure if this answers your question because the code you provided doesn't line up with the question you asked.
The code you provided looks like you are trying to move an axes from one figure to another. You can totally do this!
f = figure('Position', [100 100 100 100]);
a = axes('Parent', f);
pause
f2 = figure('Position', [250 100 100 100]);
set(a,'Parent', f2);
After much trial and error and reading of documentation, I have found that there is no way to explicitly specify the parent of the map axes. Instead, they are implicitly added on top of the current axes. In the instance that no axes exist in the current figure, calling axesm creates an axes object and then places the axesm object inside. When you take this route, you have to grab the axes object handle by calling gca:
mapAxesHandle = axesm(...);
axesHandle = gca(...);
This makes it frustrating to use the mapping toolbox when writing a GUI from scratch, but that's the way Mathworks makes it happen. Thanks to #slayton for useful info. I'd upvote but my reputation is <15 :(