Topojson - Arcs for Singapore and Hong Kong - data-visualization

I noticed world-110m.json and world-110m2.json at https://github.com/mbostock/topojson/tree/master/examples didn't have the paths for Singapore and Hong Kong. I looked in the Natural Earth data set that generates the world-110m.json file, and noticed that Singapore was listed in the tiny_countries file, but only as a point, not as a polygon. The normal countries file does not appear to include Singapore. However, notice on http://techslides.com/d3-world-maps-tooltips-zooming-and-queue/ that Singapore is not a point, but a path.
I notice that the above link has paths for Singapore and Hong Kong. However, I'm having some problems using the files from that page because of some complicated code and would prefer to insert the arcs manually.
Thanks!

ok, found a solution to this 💡
1) get this specific admin-0 countries shapefile zip from natural earth Admin - 0 Countries | Download countries https://www.naturalearthdata.com/downloads/10m-cultural-vectors/
2) upload that 5mb ne_10m_admin_0_countries.zip shapefile zip you downloaded from Natural Earth to https://mapshaper.org/
use the mouse to drag and the scroll wheel or the plus button to zoom and notice that both Hong Kong and Singapore exist as shapes/polygons in this shapefile:
Hong Kong
Singapore
3) in mapshaper, click simplify and then check prevent shape removal in the simplification menu that pops up
4) simplify your geography and then export it to topojson. 1% simplified is close to the ~500k filesize of the original world-110m2.json file (edited)
the resulting "whole worth with shapes preserved for tiny countries" topojson files that I came up with are shared in this github reposititory https://github.com/micahstubbs/tiny-countries-geo/tree/master/out

Related

Enforce MapBox Geocoding API to return only results with a zipcode

I'm working with MapBox Geocoding API to have suggestions of addresses in the location search feature of my website.
The following is a sample call:
https://api.mapbox.com/geocoding/v5/mapbox.places/Zur.json?country=ch&limit=5&proximity=8.765.432&language=en-GB&access_token=***
My goal is to enforce the api to return only results that include a zipcode.
For example if I input "Zur" (limiting the search to Swiss) I get the following:
- Zürich, Zürich, Switzerland
- Zürich, Switzerland
- Zürich Airport, Flughafenstrasse, Kloten, Zürich 8302, Switzerland
- Zurich, Buchs, Zürich 8107, Switzerland
The expected results should be without the first two lines, as they don't have a zipcode.
I tried implementing myself the removal of results without the zipcode on client side (just after I got an answer from the api), but it is a suboptimal solution (for example it doesn't ensure to have enough results).
I was not able to find such feature in MapBox. Is there a better solution out of there?
Just add ?types=address
See all list of types:
https://docs.mapbox.com/api/search/geocoding/#data-types

Retrieve shapefile from ESRI ArcServer (proxy.ashx)

Alberta has an ESRI map about the Oil Sands (OSIP): Link.
When you save the webpage you will get an proxy.ashx file which seems to contain the whole geometry:
dojo.io.script.jsonp_dojoIoScript9._jsonpCallback({"displayFieldName":"Operator_Name","fieldAliases":{"OBJECTID":"OBJECTID","OSP_NO":"Project
Number","Project_Name":"Project Name","OS_Area":"Oil Sands
Area","Industry_Type":"Industry Type","Project_Status":"Project
Status","Year":"Year","Shape.STArea()":"Shape.STArea()","Shape.STLength()":"Shape.STLength()","Operator_Name":"Operator
Name"},"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":102100,"latestWkid":3857},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"OSP_NO","type":"esriFieldTypeSmallInteger","alias":"Project
Number"},{"name":"Project_Name","type":"esriFieldTypeString","alias":"Project
Name","length":255},{"name":"OS_Area","type":"esriFieldTypeString","alias":"Oil
Sands
Area","length":5},{"name":"Industry_Type","type":"esriFieldTypeString","alias":"Industry
Type","length":3},{"name":"Project_Status","type":"esriFieldTypeString","alias":"Project
Status","length":3},{"name":"Year","type":"esriFieldTypeSmallInteger","alias":"Year"},{"name":"Shape.STArea()","type":"esriFieldTypeDouble","alias":"Shape.STArea()"},{"name":"Shape.STLength()","type":"esriFieldTypeDouble","alias":"Shape.STLength()"},{"name":"Operator_Name","type":"esriFieldTypeString","alias":"Operator
Name","length":75}],"features":[{"attributes":{"OBJECTID":1,"OSP_NO":1,"Project_Name":"Cold
Lake
Operations","OS_Area":"CL","Industry_Type":"02","Project_Status":"01","Year":2015,"Shape.STArea()":688184465.74006724,"Shape.STLength()":193203.94833874877,"Operator_Name":"Imperial
Oil
Resources"},"geometry":{"rings":[[[-12282289.675502496,7273922.0817552721],[-12282396.117050292,7273922.0677068951],
...CONTENT...
]]]}}]});
(Full paste available here)
Is there any way to export this as a shapefile?
PS: Would be great, if the proxy file could be used to circumvent ESRIs strategy to hide the geometry in SVG paths.
You may use AGStoShapefile from TannerGeo for this task.
I think this Link could solve your Problem to convert GeoJson to Shape.
https://community.esri.com/thread/105193
It matches your Question perfectly.
Regards, Miriam

Geomapping using Qlikview BI tool

I have a dataset with country names (to and from) which is similar to travel starting country and the destination country.
For example: if the travel is between India to Australia then the country origin will be India and the destination will be Australia.
I have collected the latitude and longitude for both origin and destination place.
Now I want to plot the lat and log for origin and destination country using Qlikview tool.
I'm using Qlikview11 Personal edition.
Two ways to achieve this case:
1. Using GeoQlik extension
Install GeoQlik extension in Qlikview Click to Install GeoQlik
Open GeoQlik extension in Webmode and choose Line Graph.
Add the dimensions as Country Origin and Country Destination
Add the lat and log positions as in below image.
Similarly you can do it for Country Destination.
You can also adjust the line width and color properties also.
Demerit: In GeoQlik trial version, you cant able to save the visualizations.(need to be licensed version to enjoy all the features)
2. Using Line Graph
Ref from : http://qvdesign.wordpress.com/2012/06/22/new-qlikview-chart-type-dynamic-network-flow-charts/
They used static image of world map as background. They created a line graph with X and Y coordinates running axes from 0 to 200 and set as transparent.
Here the fuzzy thing is I don't know how they calculated lat and long positions!
You can use the Qlikview Mapping Extension that installs with the product. See the "Extension Examples.qvw" in the installed examples. Note the instruction on the first sheet that directs you to complete the installation by launching the .qar file. In the Extension Examples is a sample showing how to plot lines and points on a map.

Mediawiki API: Get image from articles in specific category

Without much success, I've been trying to retrieve images (and extracts) from all posts in a certain category.
Here's a query to get the images from the main page, but I haven't found a query for specific categories.
api.php?action=query&prop=images&titles=Main%20Page
Using search seemed more promising, but still it's not what I'm looking for.
api.php?action=query&list=search&format=jsonfm&srsearch=incategory:Marine_mammals
The second query could've been a good starting point if it provided page IDs.
What you want is to use the categorymembers generator, by adding &generator=categorymembers&gcmtitle=Category%3AMarine_mammals in place of &titles. Since I discovered generators I barely remember using the API for anything else. I'd also recommend sticking to mainspace. So for example,
https://en.wikipedia.org/w/api.php?action=query&prop=images&format=json&imlimit=10&generator=categorymembers&gcmtitle=Category%3AMarine_mammals&gcmnamespace=0&gcmlimit=50
Gives:
{"query-continue":{"images":{"imcontinue":"60257|Ursus_maritimus_4_1996-08-04.jpg"}},"query":{"pages":{"149269":{"pageid":149269,"ns":0,"title":"Blubber"},"19289045":{"pageid":19289045,"ns":0,"title":"Instituto Via Delphi"},"2178272":{"pageid":2178272,"ns":0,"title":"List of marine mammals of Australia"},"60257":{"pageid":60257,"ns":0,"title":"Marine mammal","images":[{"ns":6,"title":"File:Desmostylus2DB.jpg"},{"ns":6,"title":"File:Estuary-mouth.jpg"},{"ns":6,"title":"File:FL fig04.jpg"},{"ns":6,"title":"File:Humpback Whale underwater shot.jpg"},{"ns":6,"title":"File:Hydrurga leptonyx edit1.jpg"},{"ns":6,"title":"File:Maldivesfish2.jpg"},{"ns":6,"title":"File:Oceanic whale pump - journal.pone.0013255.g001.tiff"},{"ns":6,"title":"File:PikiWiki Israel 15217 Dolphin.JPG"},{"ns":6,"title":"File:Sea lion family.JPG"},{"ns":6,"title":"File:Sea otter cropped.jpg"}]},"36425597":{"pageid":36425597,"ns":0,"title":"Marine mammals as food"},"3703749":{"pageid":3703749,"ns":0,"title":"Marine otter"},"644379":{"pageid":644379,"ns":0,"title":"North Atlantic Marine Mammal Commission"},"1336536":{"pageid":1336536,"ns":0,"title":"Sea mink"},"567471":{"pageid":567471,"ns":0,"title":"Sea otter"},"2764345":{"pageid":2764345,"ns":0,"title":"United States Navy Marine Mammal Program"}}}}

What kind of international code is used for identifying countries like

I need the name of the code in with:
ROM: Roma, Italy
BCN: Barcelona, Spain
MAD: Madrid, Spain
BUE: Buenos Aires, Argentina
PCM: Playa del Carmen, Mexico
PAR: Paris, France
LON: London, UK
etc...
I am developing an app that searches flights between countries and I need a full list of this kind of codes to interatct with another third party API.
I tried to google it but the only things that apears are flight sites instead of a wikipedia page or something.
Can you give me any pointer?
These are IATA (3 letter) Airport Codes.
This list may help you:
http://www.photius.com/wfb2001/airport_codes_alpha.html.
You could also use the official IATA search engine (Location code category).
If you want an officially sanctionned list, you apparently need to pay a hefty price.
It seems you are looking for IATA airport codes:
The assignment of these codes is governed by IATA Resolution 763, and
it is administered by IATA headquarters in Montreal. The codes are
published biannually in the IATA Airline Coding Directory.
Unfortunately, that authoritative list is quite expensive. But I am certain you can find many unofficial lists by searching the web.
Use 'World Airport Codes' search query and Google's your uncle. Below are some links from my search:
World Airport Codes
Airport Codes
Localized World Airport Codes
Openflights