For MVC Array - Polygons - which is the best way to go? - google-maps

I need to go about building 2,800 polygons (using MVC Array) for a google maps (v3) and displaying some attribute information. There seems to me that there are two ways to do this:
1) just load an array of 15,000+ points from a MySQL db file. I am planning on generating these points using a vertices command in a GIS platform. All vertice points that are vertices of a common building polygon will share the same identifier (i.e. building id). I will generate the lat/longs of each of these points in the WGS84 coordinate system (i.e. EPSG 4326) http://spatialreference.org/ref/epsg/4326.
OR
2) Parse a MySQL Geometry file (which comes in the Blob format) into a readable set of coordinates for google maps to read. I am still fuzzy on how to do this....(especially dealing with Blob)...but I suspect I need to load the file in the WGS84 coordinate system and start from there. Also, need to load the dbf file (in order to call the attributes) and correspond this with the building id.
My questions are:
Of option 1 & 2 what would be the best course of action to take for a low-experience programmer and the volume of data (i.e. 2000 polygons, which breakdown into 15000 points)?
IS WGS 84 (EPSG 4326) what I need my polygon coordinates to be in??? I've found a lot of confusion on this (some sites suggest WGS 84 - Mercator, EPSG 3857). This is a rather critical processing step to know...so I really hope for some guidance if possible.
Thanks!!!

Related

Is it possible to extract coordinates from a static map picture?

I was wondering if it were possible to extract coordinates from a static map picture like this:
Is it possible to extract the coordinates of the routes? The only idea I can come up with, other than manually getting them by hand, is by overlaying the map and extracting the exact coordinates that way.
The process that you are looking for is called georeferencing in a GIS context.
In order to determine the latitude/longitude coordinates of a point (or series of points in a line), you need to first establish coordinates of other known points. These are reference points of known locations (such as a distinctive coastline, or a city). Applying these to the raster image that you have, you can then overlay it on a map in a GIS application and then query other unknown locations on the image (such as the routes) to establish their latitude/longitude.
You could attempt this in a graphics program by looking at the x/y coordinates of the route pixels and compare to a known reference point pixel; however, the math on that is going to be tedious and you also wouldn't account for the map projection. Both of those are taken care of by georeferencing.
I would note that you should consider the results you get, even in a well-referenced GIS, to be approximate. The map deals with a very large spatial area, and the routes cover long distances. But since it dates from 2012 it was presumably made in a GIS application and so at least the source data is likely to be accurate :)
Additional resources:
Help Page for ArcGIS (both overview and instructions)
Help Page for QGIS (tutorial)

Which technology to use with Google maps

I want to develop a map application with about 500 or so polygons and some data associated with each polygon. The data for each polygon, to give an approximation, would be about 100 string fields of moderate length (say each under 50 characters). I expect this data (but not the polygons) to change arbitrarily every 10 minutes or so.
There seems to be a number of technologies to build this -- fusion table, the "raw" map api with a sql database to hold the data, map engine etc. I was wondering which of these various options is appropriate (and why) for the amount of data and level of churn I have mentioned.
I think for your case the raw map API is very appropriate. 500 polygons is a low number, map server would certainly be an overkill. For fusion tables I would go if I had thousands of markers, but not for 500. I am now using roughly this number of polygons in the raw API without problems.
PS: For drawing polygons with raw API there is a trick that took me long time to research, might come in handy later for you: Handle when drawing of polygons is complete in google maps api v3

GIS with Bing Silverlight and SQL 2008?

I have data that I want to create a GIS type application that will have the typical features of adding and removing layers of different types. What is the best architectural approach?
The data consists of property locations in Eastings and Northings.
I also have ordnance survey data in GML and Shapefiles.
I know this is a very broad question but the subject area also seems very broad to me and I am unsure which direction to go.
I was thinking of using SQL 2008 spatial and Bing Silverlight control to visualise that maps.To do this would I have to convert the eastings and northings to GWS84 geography datatype? But then if I converted the shapefiles to GML and imported all the GML files to sql using GeomFromGML they would be in geometry datatypes. Wouldn’t the two types be incompatible?
Also, should ESRI ArcGIS API for Silverlight
feature in the equation? Is this a good environment to create maps that I can point as SQL sqerver 2008 as the datasource (using a WCF service if necessary)?
Any advice greatly appreciated!
This is something I've done several times, using OS data from SQL Server in both Bing Maps AJAX and Silverlight controls. Some general comments below (in no particular order!):
Don't expect to implement full-blown
GIS functionality using Bing Maps.
Simple querying, retrieval and
display of the data is all fine (+
some simple editing), but after that
you'll be struggling with what can be
achieved in the browser.
All vector shapes supplied to Bing Maps need to be in (geography)
WGS85 coordinates, EPSG:4326.
However, all data will be projected
and displayed using (projected)
Spherical Mercator system, EPSG:3857.
In terms of vector shapes, you can expect to achieve a similar level of performance as you get in the SSMS spatial results tab - that is, (with careful architecture) you can plot up to about 5,000 features on the map at once, zoom / pan around them, click on them to bring up various properties and attributes etc. However, after that you'll find the UI becomes fairly unresponsive (which
I imagine is the reason why the spatial results tabs itself limits you to displaying 5,000 records at once).
If you want to display more features than this, one approach is to rasterize them by projecting them into the EPSG:3857 projection, creating a .PNG/.JPG image file of the features and then cutting that image into tiles according to the Bing Maps quadkey tile numbering system as explained here:
http://msdn.microsoft.com/en-us/library/bb259689.aspx and displaying them as a tilelayer. Tile layers are significantly faster than displaying the equivalent vector shapes, although it means the data is static.
If you do create raster tiles, you can either render them dynamically
or pre-render them to improve performance - i.e. you could set
up a job to render and update the tileset for slowly-changing data
every night/every month etc.
If you're talking about OS Mastermap data, the sheer level of detail
involved means that you need to think more carefully about what
features you want to display, and how you want to display them. Take
greater London, for example, which covers an area about 50km x 40km. To
create raster tiles (each of which are 256px x 256px) at zoom level 19
covering this area you'd need to render and store 1.3 million separate
tiles. If each of those is generated from a database query that takes, say
200ms to run, it's gonna take a looooonggggg time to prepare all your
data. Also, once the files have been generated, you might want to think
about storing them in a DB rather than saving them on a file system.
As for loading the OS data into SQL Server in the first place - there
are several tools that will import either from GML or shapefile into SQL
Server, and handle the projection from EPSG:27700 (Ordnance Survey
National Grid) to WGS84 along the way. Try GDAL/OGR or Safe FME for
starters.
I have a blog at http://alastaira.wordpress.com that has several blog posts that you may find useful describing various aspects of integrating Bing Maps and SQL Server. Particularly, you might want to look at:
http://alastaira.wordpress.com/2011/02/16/loading-ordnance-survey-open-data-into-sql-server-2008/
http://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/
http://alastaira.wordpress.com/2011/02/21/using-ogr2ogr-to-convert-reproject-and-load-spatial-data-to-sql-server/

ArcGIS Server - compare routes

I've got a list of points, and a route that an external provider has generated through those points.
I would like to generate a route using those same point with my own road network.
Then I want to be able to detect if there is any significant difference between the two routes.
One suggestion is that for the 2 routes, we find out what road segments they travel across, and compare the list of road segments?
Is this a valid approach?
How do we go about getting the list of road segments given a route?
I am using ArcGis server 9.3 with Java 5 and Oracle 10g. I am using the ST functions and NetworkAnalyst via the java api.
Thanks.
Calculate the route using your points and road network. Then buffer the resulting route into a polygon (the buffer radius should be your "tolerance"). Then clip the external route using your polygon. If the resulting polyline is non-empty, then there is a deviation outside of your tolerance.
This method does not acount for any "significant" deviations such as backtracking, U-Turns, or taking a nearby parallel road.
Alternatively, you can compare the resulting "directions" and check for deviations there--particuarly using street names. This saves you from checking every road segment. If you have any deviations in road names, then check the individual road segments of each section.
I've just implemented something similar in my application. I have a list of lat/long coordinates from a GPS device and needed to create a route based on this data.
I started by matching each GPS position with a node in my street network. I then removed 'consecutively duplicate' nodes to filter out those consecutive positions that are at the same node. Then, I started 'walking' through my street network, starting at the first node. I checked the first node and second node and checked for a common street segment. If I found one, great. If not, I create a shortest path between the 2 nodes and use those roads instead. I continue doing this until I've examined all the nodes. At the end of this process, I have a list of road segments that the vehicle traveled and the order in which they were traveled, too.
Unfortunately, I'm using a different map, different programming language, and different database. As such, sharing the code won't be helpful to you at all. Hopefully the process I described above will be enough help for you to accomplish your task.

How can I take numerous shapefiles and have them line up in GIS?

I am trying to take a shapefile of subdivisions within a county that I have created and line it up with another shapefile that was given to me by the County Appraisal District (parcel data). When I try to get them to line up then my streets shapefiles is not aligned with everything else. They are all on the same coordinate system and I do not want to have to recreate the shapefile for the subdivisions. Any thoughts?
This is a question with answers that may be simple or may be very complex, depending on your situation. As a GIS developer, I've most commonly seen this as a symptom of an incorrectly defined coordinate system. However, whether this is the case or not, and what the solution is strongly depends on your environment. From here on, I'll assume that you're working in an ESRI package...
I agree with the other posters that your problem is one of mismatching projections and/or datum definitions.
The most important thing to understand as regards projections in ESRI software is this:
Manually setting the projection of a dataset (shapefile, geodatabase feature class, etc) in ArcCatalog does NOT reproject that dataset!!!
In order to reproject your data, you must EXPORT the data from an ArcMap session in which you've been working and where the data is obviously lined up correctly. During the EXPORT, you are given the choice of saving your data with the coordinate system of the underlying map or that of the original dataset.
Your best bet is to follow these steps to create a new dataset with the correct projection and then extrapolate what you need to do to fix your specific problem:
Create a new ArcMap session and set its coordinate system:
Do this in a fresh ArcMap session with NO OTHER DATA. Be sure to explicitly set the coordinate system of the ArcMap mapview to your desired coordinate system (I recommend the one that matches the data you're trying to overlay, or one from another well-established dataset).
Add one other dataset with a known good coordinate system.
Create your new dataset in this ArcMap session. Give your new data the same coordinate system as the ArcMap mapview and the one other dataset in the map. Set the XY domain of the new data to exceed the area defined by your other dataset, but don't go beyond the size that will reduce your desired spatial resolution.
Create your data. It can be any data at this point. Some lines, some polygons, etc. Save your work.
Export your new dataset. When prompted, choose to save with the coordinate system of the underlying mapview.
Create a new ArcMap session and add your new dataset. Then add your parcel dataset. They should now occupy the same space in your map window.
Edit your new data to your heart's content.
Some probable issues if this doesn't help:
You didn't follow these steps correctly - check the ESRI documentation; this is a well documented issue.
The parcel data you're trying to match doesn't have properly defined coordinate system. It's always possible that the keepers of this data don't know what they're doing and have munged it up. I've seen this problem more times that I care to admit.
You've matched the projection but have mis-matched the datum. Many municipalities are still using data in NAD27, which is way out of date. Some have moved to the modern NAD83. The difference can be up to 300 meters, depending on where in the country you are. Also, data that originates from surveying or GPS equipment is usually collected in WGS84 (the typical default for satellite surveying), which is for all practical purposes the same as NAD83, at least at mapping scale resolutions.
Try researching these issues and see how it goes. I'll say it again:
Manually setting the projection does NOT actually project that data!!
Good luck!
Your problem is probably one of projection
| projection: character string that names a map projection to use. See
| 'mapproject' (in the 'mapproj' library). The default is to
| use a rectangular projection with the aspect ratio chosen so
| that longitude and latitude scales are equivalent at the
| center of the picture.
`-----
Agree that your problem is projection. Is there a .prj file extension associated with either of your files? If not key first is finding out what projects you have. I would guess State Plane of some sort if you are dealing with U.S. centric local data from a local government.
Cadastral tools (surveyer tools) usually let you specify a handful of control points and will then "warp" the data to fit to your control points. This can be anything from a simple shift to something more complex. If everything is shifted by a few feet, you can also just use your "editor" to select all shapefiles and then move them however many feet necessary.
If you've verified that both shapefiles are using the same coordinate system, then projection is less likely to be the problem. It's fairly common for parcel data to be "offset" from other data sources (such as roads). This comes from inconsistent collection methods and points of reference.
Another source of error can be that one of the shapefiles has the wrong coordinate system specified. For example, if the roads were actually WGS 1984, but it's prj is set to NAD1983, you will see some significant errors. This usually happens if you had to manually set the coodinate system for a shapefile (i.e. it didn't include a PRJ and you created one).