Highlight building on Leaflet - leaflet

Need some advise on how can I draw a outline of a particular block?
I have attached image of Singapore that is captured using OneMap, I have drawn a red outline at Blk 156, how can I do that in Leaflet or how can I retrieve the polygon coordinate of Blk 156 in OneMap API? I am currently using Leaflet and loading OneMap. I actually want to just overlay another polygon to highlight the area that user have search. Let's say user search for Blk 156, I would like to highlight the Blk 156.
Sorry if I am not clear on my question.

Related

polygon label displying duplicate in mapbox studio style editor

I have uploaded polygon shape zip file in mapbox tileset and created layer name as polygon_label but layer labels are showing duplicate inside polygon area.
So there is any way to centroid the polygon geometry or restrict to display duplicate label.
How to get label centroid of the polygon and remove duplication of the label from polygon area?
You need to create point geometries and use that as your source.
I have the same issue with a shapefile with land sections I imported. To get the outline of the land sections I added a fill type layer since the tileset contains polygon features. Then I add another layer of type symbol to be able to show the section address text field from the tileset features. I set the placement as "Point". But, the text field shows multiple places inside the polygons.
The only solution I have found is to make the labels appear along the boundries of the polygons by setting the placement as "Line". This still shows multiple labels. But, it is a bit more friendly for the user.

Some way to outline labeled regions separately?

I have processed an image to the point where I have certain labelled regions. Shown here with each labelled region in different shade.
I would like to show the outline of each region separately. Currently I am using bwmorph(labeledImage,'remove') but this treats any regions contacting each other and keeps the outlines of the conjunction of the multiple regions.
I am looking for a function that will keep all the outline / edge pixels for each region, something that would result in an image like the following (green edges added to show what is missing from the method I am already using).
You can differentiate all regions, so why dont you treat them separatly?
See this bwboundaries.

Latlonaltbox for an entire country

I'm trying to create a region which covers Sweden.
In the Region i placed a LatLonAltBox but I'm not sure what coordinates to put in.
I've read the KML Reference guide on developer.google.com but it didn't make me any wiser.
Can someone explain how to look up the coordinates and show which coordinate goes where.
<LatLonBox>
<north>90.0</north>
<south>-90.0</south>
<west>-180.0</west>
<east>180.0</east>
</LatLonBox>
The <LatLonAltBox> should contain the max and min bounds for the given region such that north is the northern-most latitude, south is the southern-most latitude, east is the eastern-most longitude, and west is the western-most longitude.
There are two ways to create a Region for a given area or country:
1) One way is to open the world country KML overlay in Google Earth then copy the country feature (E.g. Sweden). This approach will extract the exact coordinates of the region.
World Countries as Polygons. Next generation
https://productforums.google.com/d/msg/gec-tools/rNjNRYbaWSI/5x5vfgxc0w0J
To copy the Sweden geometry, press Ctrl-F to search for Sweden then right-mouse click on the placemark and select 'Copy'. This copies the KML into the clipboard.
Next visit the Bounding Box tool and paste the polygon for Sweden into the text box.
The generated line marks the 4-corner boundary points of Sweden in longitude-latitude pairs:
<coordinates>
11.11333,55.34,0
11.11333,69.0603,0
24.16701,69.0603,0
24.16701,55.34,0
11.11333,55.34,0
</coordinates>
To make it readable you should insert new lines after each longitude-latitude pair. Now pick the largest and smallest longitude: 24.16701, 11.11 and largest/smallest latitude values: 69.0603, 55.34.
Next, insert those values in appropriate tags in LatLonAltBox element as shown below:
<Region>
<LatLonAltBox>
<north>69.0603</north>
<south>55.34</south>
<west>24.16701</west>
<east>11.11</east>
</LatLonAltBox>
</Region>
2) To create an arbitrary region In Google Earth there is a trick to create an ImageOverlay over the particular region on the map. Follow these steps:
In Add menu, click 'Image Overlay'.
Click 'Browse...' and pick any image
Stretch the image to cover the bounds of the particular
region. NOTE: You may have to make the image semi-transparent to
see the underlying map.
Click Location tab to see the bounds of the
region.
When done click "OK" to save the image overlay.
Right-mouse click on the created image overlay, select "copy", and
paste KML into a text editor.
The <LatLonBox> of the GroundOverlay (aka ImageOverlay) will be the values needed for a
Region's LatLonAltBox. Rename element LatLonBox to LatLonAltBox and
copy/paste into the Region of your target KML.

In Dojo, how can I drawing custom markers at data points?

I'm using Dojo for drawing my charts. I need to draw an overlay at certain points. Almost like a tooltip that’s always shows. It can be a stack of values or an icon that display above, below or next to the data-point.
Does anyone know how I can accomplish this?
Does anyone know how I can access the list of screen coordinates for each plotted data-point?
My theory is; if there is no way to draw a persistent and custom tooltip, to draw over the chart and position my custom object in relation to the point coordinate.
Another option would be to draw a custom marker. (Not like the normal SVG paths.)
Please don’t suggest another charting library. I need to know how to do this in Dojo.
Thanks in advance.
I am not sure if you already have found an answer to using custom markers. I am using the SVG path variable for plotting the custom marker.
For eg:
var custom_marker = "M150 0 L75 200 L225 200 Z" // a triangle
var data = [{x: 10, y: 20, marker: custom_marker}, {x: 15, y: 25, marker: custom_marker}] // and so on
Feed this data into dojo chart and you can plot the custom marker.

Using custom point markers in Matlab Mapping Toolbox

I'm trying to find out if it's possible to create custom point markers (from some image files) in Matlab with Mapping Toolbox.
So far, I didn't find anything about this in their documentation. Online searches only yielded:
No. The marker shapes are hard-coded and you cannot add new ones. If you want a custom
marker, then at each point you want the marker, you will have to use line() or
equivalent to draw the marker or image() or equivalent to draw in an image.
(Source: http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/4fe4e31f191f7080)
PS: I also cross-posted this to https://gis.stackexchange.com/questions/3413/using-custom-point-markers-in-matlab-mapping-toolbox
How about this? Image Markers: Plots an image and superimposes a binary image as a colored marker.