Reference GIS Region from Shape File in Anylogic - gis

I have a GIS Map in which I uploaded a shape file with the zipcodes of a given region. I want to generate random points inside these regions, but I haven't been able to get the region element with the zipcode String name. I tried using the searchRegionFirst and searchRegion functions with the region name loaded from the shape file but they end up finding other places not related to the zones I have. Is there a way to get the region by its custom name?
Thank you

I could solve it, I just leave the question in case someone runs into the same problem. So just go to the project panel and under the main->presentation->level->map you can find all the GISRegions created. Just select them all with shift and with the right click you can find the option to create a Collection of the GISRegions. Then just use this collection to iterate through the zones.

Related

How to load longitude and latitude information into cesium kmlDataSource?

I want to display the kml file in cesium globe, and as described in the cesium's workshop code, we need to load the file by passing it with the file location (or URL). The following line of code is the specific line of code that cesium loads the kml.
var geocachePromise = Cesium.KmlDataSource.load('./Source/SampleData/sampleGeocacheLocations.kml', kmlOptions);
The entire code is available here
My question is: I have the longitude, and latitude, (and height) information saved in variables and instead of always saving them into .kml file and then load them via folder, I want to pass this information to cesium kmlDataSource (the code above) directly.
It would be great if anyone has any solution to this.
Please let me know if further information or code snapshot is required. Thanks
If you already have the information you need stored in JavaScript variables, there's no need to export to KML and import it back into Cesium. You can directly add the indicators you need as Cesium Entities, which is what the KML loader is creating when it reads a KML.
Typically, a KML-like pin is represented by a Cesium Entity containing either a point or a billboard, and optionally an associated label.
Here are some relevant demos that show how this is done:
Billboard demo
Map Pin demo
Label demo
Each of these demos calls viewer.entities.add({ ... }) along with a position for the Entity and some sort of graphical indication(s) to display to the user. You may place one of each on an Entity, for example a billboard and a label are often both defined when adding a typical KML-like Entity.
If your data is stored on the server however, you will need some mechanism to stream it to the browser. CZML is Cesium's native format for doing so, but KML is also available as an alternative for certain kinds of graphics. You may also use any API of your own design, and create Entities when the data becomes available in JavaScript.

extracting data in csv or excel form from an interactive map

I'm not a programmer but i was wondering if it would be possible to extract a list of zipcodes and median income in either csv or excel form from this interactive map.
http://www.wnyc.org/story/174508-blog-census-locates-citys-wealthiest-and-poorest-neighborhoods/
Data used from the map is coming from this website:
http://factfinder.census.gov/faces/nav/jsf/pages/index.xhtml
You can find also here some data related:
http://www.census.gov/quickfacts/map/RHI225214/36
About your map, i recommend you to find another way to extract those data, like a database or a tool available on a website, or use links provided.

I notice world file is missing the zone paramter

I'm just trying to figure out how to create world file. I saw some explanation but I notice world file having the easting and northing values but not the zone value. So how the location of the map will be identified, or I'm missing something.
Thanking you.
The world file does specify numerical geographical location for an image, but it unfortunately does not contain any information about what coordinate systems is used.
Such information typically comes in a separate file with extension .prj and is defined usually with the WKT standard and via a unique EPSG code of the coordinate system.
To simplify the search for coordinate system definitions we created an online tool:
http://epsg.io/
There you can use simple search phrases and preview position of any coordinates on a map - and also download the .prj file mentioned above.
Because you have tagged your question with "maptiler" I expect you want to cut the map tiles from your geodata and world file with the MapTiler software.
The coordinate systems can be specified directly in MapTiler easily. See http://www.maptiler.com/how-to/coordinate-systems/

How to shorten code for geoJSON file

I'm building a Florida county map using geoJSON. I downloaded 67 county files and combined them in Cartodb. The current file is huge: 4MB with thousands of lines of code, especially in the coordinates. Here's what it looks like. The map works, but it's slow to load on the browser. I've seen other JSON files that are smaller and easier on the browser. Is there a way to shorten the code so they still show the counties on my map? Maybe removing a majority of the coordinates?
you can use TopoJSON which is a topology encoding extension to GeoJSON.
"Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs."
read more: https://github.com/mbostock/topojson/wiki
repo:
https://github.com/mbostock/topojson
Not trivial. One problem is that you have multiple counties, using the same coordinates so they fit together (so the east of county A and the west of county B are identical).
You can analyse your data: If you have a line A->B->C, you can calculate how the area changes if you emit point B. Remove points as long as the total change in area is small. Make sure that if you remove a point in one county it must be removed in the other counties as well. Then you may check how much change you get by leaving out the last decimal of each point. Again, the same point must be changed in the same way in all counties.
There is a Free API to obtain US County in GeoJson format..u can add multiple counties(since u have a list)
https://www.mashape.com/vanitysoft/boundaries-io
Example query:.../rest/v1/public/boundary?and=true&county=Washington+County&state=MD
please note that some zipcodes do not fall within a county.

extracting CSV data

I am trying to build a custom map in Tile Mill and am new to programming in general so I apologize is if comes off as uninformed. I've done research but I'm not sure if I'm looking in the right place.
My basic question: this is an embedded map of restaurants in the SF area. Is there a way for me to extract the data for the locations to use in building a custom map of my own?
http://www.sfgate.com/food/top100/2012/map/
It seems that if the location markers exist on a map, that meta data is somewhere, I just don't know how/where to access it....I believe the raw formats for inputting location into a map are CSV or KML and wondering if there is a way to extra these data types from embedded maps.
Thanks!!
View the source of the page in question, look for the data (it's under the variable mapLocs, copy it from the page, and write a little script to convert their format to CSV.
^ this is likely against at least 2 different copyrights (newspaper's & geocoder's), so proceed at your own risk.