Latlonaltbox for an entire country - coordinates

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.

Related

In Tableau Map plot multiple sites at same lat long

I have a data where at one latitude and longitude multiple shops are located.
For Example.
Latitude Longitude ShopId Type
6.24458 50.001756 101 Saloon
6.24458 50.001756 102 Groceory
6.24458 50.001756 103 Pharmacy
6.24458 50.001756 104 FishMarket
When on map I am plotting using above latitude & longitude I am getting single mark. And when I hover the mark I am getting single shop details but I want 4 marks and on each mark it should show respective shopid and Type.
I am new to Tableau and not able to figure out how to do it.
You are likely getting 4 marks displayed at the same location. So when you click on the mark you see, then you are only selecting the top mark. You can verify this by dragging over the mark to select all the marks within a selection rectangle. If you then, right click and view data, you should see all 4 marks.
Another thing that can help when you have overlapping marks, is to make the marks partially transparent and add a border around the marks. Both options are available by clicking on the Color button on the marks card to get to the advanced color settings.
If this is not the behavior you want, you have a couple of options. One easy approach is to add a little random noise to each latitude and longitude (called jitter). Adding a little jitter makes the marks visible, although the size of the jittering depends on your data and scale. Jittering is especially useful if all your points are geocoded to the same situation - say if every building with a Los Angeles address is treated as if it is located at city hall. In that case, the geocoding distorts the data to a degree that jittering is just fine.
The undocumented RANDOM() function is an easy way to add some jitter. Excel and Hyper Extracts support RANDOM() among other data source types. It returns a number between 0 and 1.
The other options involve treating your coordinates as continuous dimensions instead of measures, and then using some other visual attribute size, color etc to indicate the number of items at each location. It is often useful to combine nearby items with some sort of grid or hex bin function -- In this case, instead of adding random noise to each coordinate, you round or truncate it in someway to effectively snap points to a grid. The ROUND() and HEXBINX() HEXBINY() functions are useful here. When using this approach, be sure your packed coordinate fields are continuous dimensions and have the appropriate Latitude or Longitude geographic role.
Finally, take a look at the density mark type. It can make visual heat maps, either working with exact data points or grid packed points.

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.

How to overlay Long/Lat points on a existing map

I have an existing map of ward in Chicago in Tableau:
I have a separate CSV file, linked to primary data source by Ward. It contains pairings of Long/Lat points. I can make a map of it by itself, but cannot find a way to place the points on this map. How would I do that?
If you want to overlay the dots to the existing area map you will need to use dual axis. Steps to follow are:
drag latitude (or longitude) from the csv datasource to rows (or columns); this will create another map
right click on the newly added measure and select "Dual axis"; this will overlap the two maps
in the marks box on the left you will be able to select different display settings for the two axis you will then have
You can also find a nice tutorial here

How to extend an OSM or raster area in Qgis (into 'No Data' area)?

I need to do the opposite of clipping down a raster in Qgis (or Gdal, Python etc - even R if someone can provide the script).
I have a dataset from Open StreetMap (*.OSM) which includes the south west corner of a country. I have also converted this to a SHP file or Raster format).
To match with my other Maxent datasets I need to expand the OSM data south and west so I am only increasing the 'no data' areas at the left and bottom of the files.
Is there a way to do this in Qgis?
This process worked for me:
http://ssrebelious.blogspot.co.uk/2012/09/raster-extent-modification-using-qgis.html
"In QGIS you can change extent of the rasters. Lets examine one of the worst case scenarios. There are two overlapping (one band) rasters A and B. Say, we need to add A values to B values and get the final image to have extent that will contain both images."

Place a marker in each country with mapbox

I am using Mapbox to build a multiple choropleth map.
Something along the lines of this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/choropleth-joined-data-multiple-variables/
I am using countries instead of US states however.
I've got the map working and I can switch between layers
I have an extra requirement however to add a marker in each country that displays how many projects are active in that country.
I found out how I can add custom markers to the map with this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/divicon/
The problem is I need to put a marker in the center of each country.
Does anybody know a way to put a marker in the middle of each country?
I tried to use the natural earth admin 0 label points data but that has multiple points per country. It looked like the 'scalerank=0' points were the middle of the countries but if I filter on these points, I still get multiple points for some countries (russia has 4 for instance, but Belgium has 4 as well).
If you plot all scalerank 0 points on a map you get the following result:
https://a.tiles.mapbox.com/v4/persyval.jg5p7gm7/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#6/45.159/12.206
Does anybody know about a dataset that has one point per country or another way to put a marker in the center of each country with mapbox?
It seems it's hard to find a list of country points for the placing of markers.
So I took the mentioned admin labal 0 points and tried to sanitize it to have only one appropiate marker per country.
The result can be downloaded here in GEOJSON format:
https://drive.google.com/file/d/0B6IQhfb-UYeUYk1mcUZaMmV0S1U/edit?usp=sharing
If you want to have a visual representation of the points take a look at this map:
https://a.tiles.mapbox.com/v4/persyval.jgk4767c/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#4/36.49/34.32
I needed this points for a proof of concept project so I haven't checked all markers meticulously, I also haven't taken account some of the more political sensitive country borders.
If you have a project in which this is of importance please check the file before using, but the points in this file can be easily edited to your own preferences.