Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbuckl/2b37d8f61f590a63cb143c8a84bc6a77 to your computer and use it in GitHub Desktop.
Save tbuckl/2b37d8f61f590a63cb143c8a84bc6a77 to your computer and use it in GitHub Desktop.
Title Post Link Id Score ViewCount Body
Measuring accuracy of latitude and longitude? { "id": 8650, "title": "Measuring accuracy of latitude and longitude?" } 8650 323 283565 <p>I have latitude and longitude as <code>19.0649070739746</code> and <code>73.1308670043945</code> respectively. </p> <p>In this case both coordinates are <code>13</code> decimal places long, but sometimes I also get coordinates which are <code>6</code> decimal places long. </p> <p>Do fewer decimal points affect accuracy, and what does every digit after the decimal place signify?</p>
Does Y mean latitude and X mean longitude in every GIS software? { "id": 11626, "title": "Does Y mean latitude and X mean longitude in every GIS software?" } 11626 70 281770 <p>I am using Mapinfo and it has Y as latitude and X as longitude. Is that the same case for all mapping software? As for any country their respective value is multiple of 1 or -1. So for Nepal can I say it is on positive side +1 for both latitude and longitude? And for USA to be +1 Y and -1 X.</p>
What is the difference between Vector and Raster data models? { "id": 57142, "title": "What is the difference between Vector and Raster data models?" } 57142 14 243635 <p>From: <a href="http://support.esri.com/en/knowledgebase/GISDictionary/term/vector%20data%20model">http://support.esri.com/en/knowledgebase/GISDictionary/term/vector%20data%20model</a></p> <blockquote> <p><em><strong>vector data model</em></strong>: [data models] A representation of the world using points, lines, and polygons. Vector models are useful for storing data that has discrete boundaries, such as country borders, land parcels, and streets.</p> <p><em><strong>raster data model</em></strong>: [data models] A representation of the world as a surface divided into a regular grid of cells. Raster models are useful for storing data that varies continuously, as in an aerial photograph, a satellite image, a surface of chemical concentrations, or an elevation surface.</p> </blockquote> <p>All I have understood from the above is that both vector and raster data constitute of "latitudes and longitudes", only. The difference is in the way they are displayed.</p> <p>Latitudes and Longitudes in Vector data are displayed in the form of lines, points, etc.</p> <p>Latitudes and Longitudes in Raster data are displayed in the form of closed shapes where each pixel has a particular latitude and longitude associated with it. </p> <p>Is my understanding correct?</p>
Calculating longitude length in miles? { "id": 142326, "title": "Calculating longitude length in miles?" } 142326 35 189312 <p>Suppose I have geographic coordinates of "Saratoga, California, USA" as </p> <pre><code>Latitude: 37°15.8298′ N Longitude: 122° 1.3806′ W </code></pre> <p>I know <a href="http://www.colorado.edu/geography/gcraft/warmup/aquifer/html/distance.html" rel="noreferrer">from here</a> that in case of latitude <code>1° ≈ 69 miles</code> and that longitude varies:</p> <pre><code>1° longitude = cosine (latitude) * length of degree (miles) at equator. </code></pre> <p>So my question is how many miles is 1° longitude at <code>longitude: 122°1.3806′ W</code>?</p>
Display a local file in Google Maps { "id": 235, "title": "Display a local file in Google Maps" } 235 42 188649 <p>How can I get a KML/KMZ file to display on Google Maps without a public facing web server? </p>
Adding Basemaps from Google or Bing in QGIS? { "id": 20191, "title": "Adding Basemaps from Google or Bing in QGIS?" } 20191 88 169494 <p>ArcGIS Desktop has the option of using basemaps from ArcGIS online.</p> <p>Does QGIS have any such options?</p>
What ratio scales do Google Maps zoom levels correspond to? { "id": 7430, "title": "What ratio scales do Google Maps zoom levels correspond to?" } 7430 74 167527 <p>Can anyone provide me with a link (or some details) on the actual ratio to "zoom level" figures for Google Maps?</p> <p>e.g. <strong>Google Maps Level 13</strong> = 1:20000</p>
Export list of values into csv or txt file { "id": 72458, "title": "Export list of values into csv or txt file" } 72458 4 161525 <p>I would like to know how to export in Arcgis a list of values calculated in python script into one of the following data formats: csv, txt, xls, dbase or other. I would also like to know how to create such file in case that it doesnt exist.</p> <p>The list of values looks like res=(1,2,3,...,x). Each value must be written into a new row.</p>
Merging multiple vector layers to one layer using QGIS? { "id": 25061, "title": "Merging multiple vector layers to one layer using QGIS?" } 25061 65 142499 <p>I've imported several shapefiles which where exported from a Mapinfo .tab. Several tab files are imported resulting in 20+ layers. Afterwards I want to export it to geoJSON; but I'm reluctant to select each layer and export it manually.</p> <p>Is there a way to merge all the layers into one using QGIS?</p>
Avoiding Google Maps geocode limit? { "id": 15052, "title": "Avoiding Google Maps geocode limit?" } 15052 30 139358 <p>I'm creating a <a href="http://www.mediwales.com/mapping/" rel="nofollow noreferrer">custom google map</a> that has 125 markers plotted via a cms. When loading the map I get this message:</p> <blockquote> <p>Geocode was not successful for the following reason: OVER_QUERY_LIMIT</p> </blockquote> <p>I'm pretty sure it's the way in which I've geocoded the markers.</p> <p>How can I avoid these warnings and is there a more efficient way to geocode the results?</p> <p>UPDATE: This is my attempt at Casey's answer, I'm just getting a blank page at the moment.</p> <pre><code>&lt;script type="text/javascript"&gt; (function() { window.onload = function() { var mc; // Creating an object literal containing the properties we want to pass to the map var options = { zoom: 10, center: new google.maps.LatLng(52.40, -3.61), mapTypeId: google.maps.MapTypeId.ROADMAP }; // Creating the map var map = new google.maps.Map(document.getElementById('map'), options); // Creating a LatLngBounds object var bounds = new google.maps.LatLngBounds(); // Creating an array that will contain the addresses var places = []; // Creating a variable that will hold the InfoWindow object var infowindow; mc = new MarkerClusterer(map); &lt;?php $pages = get_pages(array('child_of' =&gt; $post-&gt;ID, 'sort_column' =&gt; 'menu_order')); $popup_content = array(); foreach($pages as $post) { setup_postdata($post); $fields = get_fields(); $popup_content[] = '&lt;p&gt;'.$fields-&gt;company_name.'&lt;/p&gt;&lt;img src="'.$fields-&gt;company_logo.'" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="'.get_page_link($post-&gt;ID).'"&gt;View profile&lt;/a&gt;'; $comma = ","; $full_address = "{$fields-&gt;address_line_1}{$comma}{$fields-&gt;address_line_2}{$comma}{$fields-&gt;address_line_3}{$comma}{$fields-&gt;post_code}"; $address[] = $full_address; } wp_reset_query(); echo 'var popup_content = ' . json_encode($popup_content) . ';'; echo 'var address = ' . json_encode($address) . ';'; ?&gt; var geocoder = new google.maps.Geocoder(); var markers = []; // Adding a LatLng object for each city for (var i = 0; i &lt; address.length; i++) { (function(i) { geocoder.geocode( {'address': address[i]}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { places[i] = results[0].geometry.location; // Adding the markers var marker = new google.maps.Marker({position: places[i], map: map}); markers.push(marker); mc.addMarker(marker); // Creating the event listener. It now has access to the values of i and marker as they were during its creation google.maps.event.addListener(marker, 'click', function() { // Check to see if we already have an InfoWindow if (!infowindow) { infowindow = new google.maps.InfoWindow(); } // Setting the content of the InfoWindow infowindow.setContent(popup_content[i]); // Tying the InfoWindow to the marker infowindow.open(map, marker); }); // Extending the bounds object with each LatLng bounds.extend(places[i]); // Adjusting the map to new bounding box map.fitBounds(bounds) } else { alert("Geocode was not successful for the following reason: " + status); } }); })(i); } var markerCluster = new MarkerClusterer(map, markers); } }) (); &lt;/script&gt; </code></pre> <p><strong>It doesn't really matter what the solution is as long as the markers load instantly and it's not breaking any terms &amp; conditions.</strong></p>
What is the difference between DEM, DSM and DTM? { "id": 5701, "title": "What is the difference between DEM, DSM and DTM?" } 5701 88 132337 <p>I am listing some of the acronyms used in our work and had to stop to think about whether to list these together or separately:</p> <ul> <li>DEM: Digital Elevation Model</li> <li>DSM: Digital Surface Model</li> <li>DTM: Digital Terrain Model</li> </ul> <p>In some circles they seem synonymous, in others they seem to have distinct meanings. </p> <p>Is there an agreed-upon definition for each that enables them to be distinguished?</p>
How to change default zoom in the Google embedded map? { "id": 70809, "title": "How to change default zoom in the Google embedded map?" } 70809 14 130847 <p>I am having difficulties to change the default zoom level when I open the iframe below in my site. Can anyone please help me to set zoom level when following iframe is opened?</p> <pre><code>&lt;iframe src="http://mapsengine.google.com/map/u/0/embed?mid=zYk_BmXXTdxw.k83snDbX5SJc" width="745" height="480"&gt;&lt;/iframe&gt; </code></pre> <p>This is the newest version of Google Maps.</p>
Algorithm for offsetting a latitude/longitude by some amount of meters { "id": 2951, "title": "Algorithm for offsetting a latitude/longitude by some amount of meters" } 2951 82 129588 <p>I'm looking for an algorithm which when given a latitude and longitude pair and a vector translation in meters in Cartesian coordinates (x,y) would give me a new coordinate. Sort of like a reverse Haversine. I could also work with a distance and a heading transformation, but this would probably be slower and not as accurate. Ideally, the algorithm should be fast as I'm working on an embedded system. Accuracy is not critical, within 10 meters would be good.</p>
What are Raster and Vector data in GIS and when to use? { "id": 7077, "title": "What are Raster and Vector data in GIS and when to use?" } 7077 47 125401 <p>What are raster and vector data in the GIS context? </p> <p>In general terms what applications, processes, or analysis are each suited for? (and <em>not</em> suited for!)</p> <p>Does anyone have some small, concise, effective pictures which convey and contrast these two fundamental data representations?</p>
Export Google Maps Route to KML/GPX { "id": 152571, "title": "Export Google Maps Route to KML/GPX" } 152571 22 116557 <p>Since Google pulled the plug on Google Maps Classic, I'm reluctantly moving to its <a href="https://www.google.com/maps/dir/">Google Maps New</a> application.</p> <p>However, I didn't find how to export a route to a GPX or KML file so it can be copied onto my smartphone.</p> <p>Can it do this? If not, is there a third-party solution?</p>
Installing File Geodatabase (*.gdb) support in QGIS? { "id": 26285, "title": "Installing File Geodatabase (*.gdb) support in QGIS?" } 26285 140 115180 <p>I have spent around 2 days to find the way to open GDB (Esri geodatabase) in QGIS (or any other open source software) but still without success.</p> <p>I have downloaded the newest OSGeo4W installer and tried the setup - express desktop install - all packages, as well as advanced install incl gdal-filegdb.</p> <p>Can you describe a more detailed procedure, including installation and how to open .gdb in QGIS (OSGeo4W installation)?</p>
EPSG 3857 or 4326 for GoogleMaps, OpenStreetMap and Leaflet { "id": 48949, "title": "EPSG 3857 or 4326 for GoogleMaps, OpenStreetMap and Leaflet" } 48949 137 114978 <p>The discussion at <a href="https://gis.stackexchange.com/questions/3334/what-is-the-difference-between-wgs84-and-epsg4326">What is the difference between WGS84 and EPSG4326?</a> shows that <em>4326 is just the EPSG identifier of WGS84.</em>.</p> <p>Wikipedia entries for Google Maps and OpenStreetMap shows that they both use WGS 84.</p> <p><a href="http://wiki.openstreetmap.org/wiki/EPSG:3857" rel="noreferrer">http://wiki.openstreetmap.org/wiki/EPSG:3857</a> states that </p> <p><em>EPSG:3857 is a Spherical Mercator projection coordinate system popularized by web services such as Google and later OpenStreetMap.</em> </p> <p>Leaflet's help states:</p> <p><em>EPSG3857 The most common CRS for online maps, used by almost all free and commercial tile providers. Uses Spherical Mercator projection. Set in by default in Map's crs option.|</em></p> <p><em>EPSG4326 A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.</em></p> <p>This is confusing - it seems that Google Maps and OpenStreetMap use EPSG3857 but they use WGS84 which 'is' EPSG4326. Something can't be right here, most likely my understanding. </p> <p>Could someone help me understand?</p>
Calculating polygon areas in QGIS? { "id": 23355, "title": "Calculating polygon areas in QGIS?" } 23355 58 106947 <p>How do I calculate areas of an area shapefile in square meters or in acres (ha)?</p> <p>I didn't find that functionality in the vector tools.</p>
Getting coordinates from click or drag event in Google Maps API? { "id": 33238, "title": "Getting coordinates from click or drag event in Google Maps API?" } 33238 9 105313 <p>I have made a Google Version 3 Geocoder , I want to be able to pick up the coordinates of the marker when it is dragged or clicked. Below is my code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no"/&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt; &lt;title&gt;Google Maps JavaScript API v3 Example: Geocoding Simple&lt;/title&gt; &lt;link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="http://maps.google.com/maps/api/js?v=3.5&amp;amp;sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } function codeAddress() { var address = document.getElementById("address").value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, draggable: true, position: results[0].geometry.location }); } else { alert("Geocode was not successful for the following reason: " + status); } }); } &lt;/script&gt; &lt;style type="text/css"&gt; #controls { position: absolute; bottom: 1em; left: 100px; width: 400px; z-index: 20000; padding: 0 0.5em 0.5em 0.5em; } html, body, #map_canvas { margin: 0; width: 100%; height: 100%; } &lt;/style&gt; &lt;/head&gt; &lt;body onload="initialize()"&gt; &lt;div id="controls"&gt; &lt;input id="address" type="textbox" value="Sydney, NSW"&gt; &lt;input type="button" value="Geocode" onclick="codeAddress()"&gt; &lt;/div&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I have tried to use the following code to do this but it does not seem to work.</p> <pre><code> // Javascript// google.maps.event.addListener(marker, 'dragend', function(evt){ document.getElementById('current').innerHTML = '&lt;p&gt;Marker dropped: Current Lat: ' + evt.latLng.lat().toFixed(3) + ' Current Lng: ' + evt.latLng.lng().toFixed(3) + '&lt;/p&gt;'; }); google.maps.event.addListener(marker, 'dragstart', function(evt){ document.getElementById('current').innerHTML = '&lt;p&gt;Currently dragging marker...&lt;/p&gt;'; }); map.setCenter(marker.position); marker.setMap(map); //HTML// &lt;div id='map_canvas'&gt;&lt;/div&gt; &lt;div id="current"&gt;Nothing yet...&lt;/div&gt; </code></pre>
Converting between KML and shapefile (SHP) format? { "id": 98, "title": "Converting between KML and shapefile (SHP) format?" } 98 92 102614 <p>My users are sending me point data that were digitized using Google Earth. </p> <p>How can I convert their KML to a shapefile?</p>
Listing available online WMS services (Weather, Land Data, Place Names)? { "id": 6345, "title": "Listing available online WMS services (Weather, Land Data, Place Names)?" } 6345 19 98637 <p>I'm Looking for WMS services freely available to the public to overlay on my application, specifically weather and AIS information.</p> <p>Perhaps this is a good place to list some available online WMS services you have stumbled across?</p>
Why does GPS positioning require four satellites? { "id": 12866, "title": "Why does GPS positioning require four satellites?" } 12866 49 98172 <p>I have a question on the GPS positioning algorithm. In all books I've read for 3D positioning we need four satellites, and I don't understand why.</p> <p>We need to calculate three variables: x, y, z. We know when satellite send the signal to earth and when we receive it we can measure the time the signal travel to earth by checking the shift in PRN generator. For what purpose do we need four satellite?</p>
How to export attribute tables to Excel? { "id": 45619, "title": "How to export attribute tables to Excel?" } 45619 8 98119 <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://gis.stackexchange.com/questions/28308/how-do-i-export-an-attribute-table-in-arcgis-version-9-3-1-to-excel">How do I export an attribute table in ArcGIS version 9.3.1 to Excel?</a> </p> </blockquote> <p>We are running 10.0 and are trying to simply export an attribute table to Excel other than exporting to dbf and opening straight away in excel.</p> <p>The problem is our GIS Manager does not trust everything that is exported as far as formatting etc..changed info from database to excel.</p> <p>In other words..when we view the attribute table they want the same identical view in excel!</p>
What's the difference between a projection and a datum? { "id": 664, "title": "What's the difference between a projection and a datum?" } 664 188 98006 <p>What's the difference between a projection and a datum?</p>
Importing DWG into QGIS project? { "id": 32730, "title": "Importing DWG into QGIS project?" } 32730 37 97320 <p>I have a lot of DWG files like basemap, and water and wastewater network. I am looking for a way to import these files into my QGIS project.</p>
How to get coordinates from geometry in PostGIS? { "id": 42970, "title": "How to get coordinates from geometry in PostGIS?" } 42970 39 94970 <p>This line: <code>SELECT geom FROM myLayer.geom</code> will return a hex value, i'm wondering how would it be possible to get decimal values, a result that look likes human-readable coordination?</p>
What is the maximum Theoretical accuracy of GPS? { "id": 43617, "title": "What is the maximum Theoretical accuracy of GPS?" } 43617 35 94880 <p>I was talking with a potential client, and they requested that we plot some points with GPS, with a maximum (or should that be minimum?) accuracy of 2 m.</p> <p>This is an area with no WAAS, and I was under the impression that even in the best of conditions, a single gps point can be accurate up-to only 15 meters(Horizontal field). Is this correct?</p> <p>What is the maximum theoretical accuracy of GPS without using WAAS or differential GPS?</p>
Seeking Mobile GIS applications for Android Tablets? { "id": 12452, "title": "Seeking Mobile GIS applications for Android Tablets?" } 12452 64 94513 <p>I know that <a href="http://www.esri.com/landing-pages/software/mobile/arcgis-for-android" rel="nofollow noreferrer">ArcGIS is available for Android</a>, but does anyone know of any other GIS apps that are available for Android tablets?</p>
How to open a shapefile in R? { "id": 19064, "title": "How to open a shapefile in R?" } 19064 43 93151 <p>I need to open a shapefile from ArcMap in R to use it for further geostatistical analysis. I've converted it into ASCII text file, but in R it is recognized as data.frame. Coordinates function doesn't work as soon as x and y are recognized as non-numeric. Could you help to deal with it?</p>
Converting MapInfo TAB and/or MIF to SHP using free tools or ArcGIS for Desktop core product? { "id": 42, "title": "Converting MapInfo TAB and/or MIF to SHP using free tools or ArcGIS for Desktop core product?" } 42 36 92316 <p>How do I convert MapInfo TAB and/or MIF files to SHP using only free tools or ArcGIS itself? </p> <p>I've not had much luck trying to do this in the past and I don't want to have to shell out for the ArcGIS Data Interoperability extension which seems to be the 'official' way to go about this.</p>
Difference between WGS84 and EPSG:4326? { "id": 3334, "title": "Difference between WGS84 and EPSG:4326?" } 3334 93 91815 <p>What is the difference between WGS84 and EPSG 4326? </p> <p>It seems like for a given dataset it might be both WGS84 <em>and</em> EPSG:4326.</p>
Seeking General GIS Questions for Job interviews? { "id": 11485, "title": "Seeking General GIS Questions for Job interviews?" } 11485 16 90331 <p>What are some general GIS questions that are asked in an interview process, not related to any particular software but questions that can test one's core knowledge about GIS?</p>
Creating point features with exact coordinates in QGIS? { "id": 34204, "title": "Creating point features with exact coordinates in QGIS?" } 34204 43 86542 <p>How do I create point features with exact (manually entered) coordinates in QGIS?</p> <p>I get precise GPS coordinates from a survey team which I need to add to a point layer. What I want: -Add point, type in the coordinates and when pressing enter the point is created where it is supposed to be.</p>
Seeking examples of beautiful maps? { "id": 3083, "title": "Seeking examples of beautiful maps?" } 3083 184 85358 <p>Oftentimes when we make maps it is based on our subjective interpretation of what is aesthetically pleasing. I would like it if people posted examples of beautiful maps, displaying any phenomena in any manner.</p> <p>Below I have posted one of my favorite maps. This is an example of a <a href="http://www.cartogrammar.com/blog/value-by-alpha-maps/" rel="nofollow noreferrer">value-by-alpha</a> map recently asked about as <a href="https://gis.stackexchange.com/q/2784/751">How to implement value-by-alpha map in GIS?</a>, and the picture is taken from the <a href="http://www.geovista.psu.edu/" rel="nofollow noreferrer">GeoVista</a> website.</p> <p><img src="https://i.stack.imgur.com/A4NI0.jpg" alt="alt text"></p> <p><strong>Citation for the map's makers</strong>:</p> <blockquote> <p>Geovisual analytics to enhance spatial scan statistic interpretation: an analysis of U.S. cervical cancer mortality Jin Chen , Robert E Roth , Adam T Naito , Eugene J Lengerich and Alan M MacEachren <a href="http://www.ij-healthgeographics.com/content/7/1/57" rel="nofollow noreferrer">International Journal of Health Geographics 2008, 7:57</a></p> </blockquote> <p>It would be best for the cultivation of knowledge if people would elaborate on <em>why</em> the particular maps they cite are beautiful. </p> <p>The reason I believe I think the cited value-by-alpha map is beautiful is that it creates a very simple, but obvious and striking visual hierarchy with which to interpret the standardized mortality ratio's. This is in particular useful combined with the very "noisy" standardized mortality ratio's, and the typically very noisy clusters of abnormally high rates produced by the SatScan clustering technique. One can even clearly see <em>very small</em> clusters around Chicago and Philadelphia. </p> <p>There are other supplemental elements of the map that make it easy on the eyes. For example, the black background, the heavier white outline for around the states and the white outline for the states (that is blended the same as the attribute values). Maps with many polygons can particularly be distracting if one does not take care when plotting the polygon outlines. </p> <p>Also the legend is particularly well created, and effectively demonstrates the concept (although it certainly isn't a typical legend, so took some original creative thought).</p>
Installing GDAL with Python on windows? { "id": 2276, "title": "Installing GDAL with Python on windows?" } 2276 81 84943 <p>Can anyone explain how to install GDAL/OGR with Python on Windows?</p> <p>I have Windows Vista and I have tried following the information on the website and it does not seem to bind the exe files for me.</p> <p>Can someone describe the process, including links to the files/folders I will need?</p> <p>I have now tried to run the gdal setup with minGW, but this has also failed:</p> <p><img src="https://i.stack.imgur.com/pPOH1.jpg" alt="GDAL_FAIL"></p>
Inserting point into PostGIS? { "id": 24486, "title": "Inserting point into PostGIS?" } 24486 43 83863 <p>I have created one table in my PostGIS nut I cannot insert point.</p> <p>What is wrong with my query?</p> <pre><code>CREATE TABLE app ( p_id INTEGER PRIMARY KEY ); SELECT AddGeometryColumn('app','the_geom','4326','POINT',2); INSERT INTO app(p_id, the_geom) VALUES(2, POINT(-71.060316, 48.432044)); </code></pre> <p>After the last query it shows some error..</p> <pre><code>ERROR: column "the_geom" is of type geometry but expression is of type point LINE 1: ...SERT INTO app(p_id, the_geom) VALUES(2, POINT(-71.... ^ HINT: You will need to rewrite or cast the expression. ********** Error ********** ERROR: column "the_geom" is of type geometry but expression is of type point SQL state: 42804 Hint: You will need to rewrite or cast the expression. Character: 53 </code></pre> <p>I already check my PostGIS version. </p> <pre><code>SELECT PostGIS_full_version(); </code></pre> <p>I got the following output..</p> <pre><code>"POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS" </code></pre>
Turning on map view in Google Earth? { "id": 16044, "title": "Turning on map view in Google Earth?" } 16044 6 81429 <p>Why can't I toggle between map view and satellite imagery in Google Earth as I can in Google Maps?</p> <p>I am looking for an easy way to add Map View to Google Earth.</p>
Calculating Latitude/Longitude X miles from point? { "id": 5821, "title": "Calculating Latitude/Longitude X miles from point?" } 5821 38 80680 <p>I am wanting to find a latitude and longitude point given a bearing, a distance, and a starting latitude and longitude.</p> <p>This appears to be the opposite of this question (<a href="https://gis.stackexchange.com/questions/3945/distance-between-lat-long-points">Distance between lat/long points</a>).</p> <p>I have already looked into the haversine formula and think it's approximation of the world is probably close enough.</p> <p>I am assuming that I need to solve the haversine formula for my unknown lat/long, is this correct? Are there any good websites that talk about this sort of thing? It seems like it would be common, but my googling has only turned up questions similar to the one above.</p> <p>What I am really looking for is just a formula for this. I'd like to give it a starting lat/lng, a bearing, and a distance (miles or kilometers) and I would like to get out of it a lat/lng pair that represent where one would have ended up had they traveled along that route.</p>
Obtaining up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes? { "id": 5114, "title": "Obtaining up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes?" } 5114 39 77087 <p><em>NOTE: This began as a <a href="https://stackoverflow.com/q/4682194/166258">question on Stack Overflow</a>, which has subsequently been closed. I also noticed a similar question about <a href="https://gis.stackexchange.com/questions/2682/most-up-to-date-source-for-us-zip-code-boundaries">Most Up-To-Date Source for US Zip Code Boundaries</a>, but I believe this question is different in that I'm not looking for</em> <strong><em>boundaries</em></strong> <em>as much as I'm looking for</em> <strong><em>coordinates</em></strong>. <em>Sorry for new newbie question. I'm not sure where to look to find reliable and up-to-date data.</em></p> <p>We have a table in our database that has latitude and longitude geocode coordinates paired with US zip codes. A sample of the data looks like this:</p> <pre><code>Zip State Latitude Longitude 30000 GA 33.906553 -84.206311 30001 GA 33.810659 -84.607964 30002 GA 33.77429 -84.260712 30003 GA 33.906553 -84.206311 30004 GA 34.113832 -84.294578 30005 GA 34.079927 -84.221166 30006 GA 33.906553 -84.206311 30007 GA 33.968777 -84.43282 30008 GA 33.902022 -84.580318 30009 GA 33.906553 -84.206311 </code></pre> <p>The problem is that our data hasn't been updated for a few years. </p> <p>Where can I obtain (for free or for purchase) updated data for this table?</p>
Basic If/Then in Python Parser of ArcGIS Field Calculator? { "id": 81817, "title": "Basic If/Then in Python Parser of ArcGIS Field Calculator?" } 81817 16 76218 <p>I am using ArcGIS 10.2 for Desktop, and I've been looking through this site, and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with ArcGIS. I know I can do this the slow way with Select By Attributes, but It's time consuming.</p> <p>I am attempting a spatial join between cases of a disease (points layer) and US Census Tracts (polygon layer). This requires count data. For each point/case, I have a field called YEAR with date ranges 2001 to 2012 depending on what year the case happened. I need a count column for each year. For example, the first one I'm calling COUNT01. If the case date in YEAR is 2001, then COUNT01 will have a 1 in it. If it is any other year (2002-2012), then there will need to be a 0. I will have COUNT02, COUNT03...COUNT12 columns. Can't have a "Null" value. </p> <p>Here's what I've tried so far</p> <p><img src="https://i.stack.imgur.com/O98HG.jpg" alt="enter image description here"></p> <p>And here is what the data looks like in Arc.</p> <p><img src="https://i.stack.imgur.com/pLkNo.jpg" alt="enter image description here"></p>
Extract Raster Value into Polygon Attribute { "id": 40536, "title": "Extract Raster Value into Polygon Attribute" } 40536 24 75720 <p>I have Raster Data for a State which has Elevation Data in its pixels. I also have Vector layer which has the 300 divisions of State. what I need is, I want to get the average elevation value of particular division from the raster data using ArcGIS. </p> <p>I tried extract by mask in ArcGIS to extract individual polygon to clip the raster into 300 raster then from individual raster i have collected average elevation but it has taken days together to complete the work. is there any other easy way to get it.</p>
Seeking administrative boundaries for various countries? { "id": 495, "title": "Seeking administrative boundaries for various countries?" } 495 52 75677 <p>After learning about the <a href="https://www.census.gov/geo/maps-data/data/tiger-line.html" rel="nofollow">US Census's TIGERLines</a> datasets I've working with the following layers, from the USA data</p> <ul> <li>Country boundaries</li> <li>State boundaries</li> <li>County boundaries</li> <li>City boundaries</li> <li>ZipCode boundaries</li> </ul> <p>What I am trying to find is the equivalent (where appropriate) of the same data for various countries.</p> <p>Is there <em>any</em> free administrative boundaries available as shapefiles for other countries?</p>
Adding values in two columns to new column on sync table in CARTO? { "id": 114515, "title": "Adding values in two columns to new column on sync table in CARTO?" } 114515 1 73998 <p>We have field data coming in from an app platform and we want to drive a CartoDB visualisation to help with planning.</p> <p>A bunch of rangers go out surveying sites to count crocodiles. For each site, the app collects: - Number of Male crocodiles (num_croc_male) - Number of Female crocodiles (num_croc_female)</p> <p>We don't actually want our people standing there in the dark doing sums, so they upload the data in this format straight to the cloud, and this is then POSTed over to our CartoDB.</p> <p>In the CartoDB visualisation, we want to show the two cols above, and we also want: Total Number of Crocodiles (num_croc_sitetotal).</p> <p>Since this integer will also be used for styling the display of each site, I want the value stored in a column.</p> <p>And since the data is being refreshed after each patrol, I need this to be a stable transform that persists through new rows being added.</p> <p>It seems like I can't find the tutorial or walk through for how this might be done...and my SQL is nearly non-existent. I was sort of hoping CartoDB had some sort of formula-building interface that would shield me from the full blast of SQL syntax.</p> <p>Could anyone provide an outline of the solution steps I should be following here?</p>
How to show a popup on mouse-over, not on click? { "id": 31951, "title": "How to show a popup on mouse-over, not on click?" } 31951 28 73695 <p>Is it possible in Leaflet that popup opens on mouse-over, not on click?</p> <p>This is working for just one marker at a time, but I need it for a bigger number of markers:</p> <pre><code>marker.on('mouseover', function(e){ marker.openPopup(); }); </code></pre>
Getting list of coordinates for points in layer using QGIS? { "id": 8844, "title": "Getting list of coordinates for points in layer using QGIS?" } 8844 38 72645 <p>I've got a layer in <strong>QGIS</strong> that is comprised of points. Its attribute table doesn't have (show) the corresponding <strong>x</strong> and <strong>y</strong> coordinates for each point. Is there a way for me to extract a list of coordinates for those points? (ideally into a <strong>CSV</strong>, but not required)</p> <p>Also, for the exported list of coordinates (say, in a <strong>CSV</strong> file), how do I include the existing attribute table with it? </p> <p>For your information, I am running QGIS on Mac OS X 10.6.7.</p>
Converting kmz file to kml? { "id": 40944, "title": "Converting kmz file to kml?" } 40944 38 72450 <p>Is there an easy way (like unzip) to convert a KMZ file to KML?</p>
Loading external GeoJSON file into Leaflet map? { "id": 68489, "title": "Loading external GeoJSON file into Leaflet map?" } 68489 39 70518 <p>I would like to load a geoJSON (polygon) file into my leaflet map. I have seen examples where geoJSON is embedded into the javascript code but I can't find any examples showing how it is done with an external file. </p> <pre><code>&lt;head&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"&gt; &lt;link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /&gt; &lt;script src="usStates.geojson" type="text/javascript"&gt;&lt;/script&gt; &lt;style&gt; html, body, #map { height: 100%; } body { padding: 0; margin: 0; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="map" style="height: 100%"&lt;/div&gt; &lt;script src="http://d3js.org/d3.v2.min.js?2.9.3"&gt;&lt;/script&gt; &lt;script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var map = L.map('map').setView([38.57, -94.71], 4); L.tileLayer('http://{s}.tile.cloudmade.com/9067860284bc491e92d2342cc51d47d9/998/256/{z}/{x}/{y}.png', {attribution: 'Map data &amp;copy; &lt;a href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; Imagery © &lt;a href="http://cloudmade.com"&gt;CloudMade&lt;/a&gt;'}).addTo(map); var featureStyle = { "color": "#ff7800", "weight": 5, "opacity": 0.2 }; L.geoJson(usStates).addTo(map); &lt;/script&gt; &lt;/body&gt; </code></pre>
Full list of ISO ALPHA-2 and ISO ALPHA-3 country codes { "id": 1047, "title": "Full list of ISO ALPHA-2 and ISO ALPHA-3 country codes" } 1047 19 70001 <p>I'm searching for a <strong>full list of countries with their country codes</strong>.</p> <p>Like on this page (need full and valid):</p> <p><a href="http://www.nationsonline.org/oneworld/country_code_list.htm" rel="nofollow">http://www.nationsonline.org/oneworld/country_code_list.htm</a></p>
Comparing various JavaScript mapping libraries? { "id": 8032, "title": "Comparing various JavaScript mapping libraries?" } 8032 138 69260 <p>I am working on a web-based mapping system and I'm trying to figure out which library to use.</p> <p>These are links to comparisons of available libraries:</p> <ul> <li><a href="http://www.geotests.net/cours/sigma/webmapping/tableau_webmapping2010.pdf" rel="nofollow noreferrer">Laurent Jegou's benchmark</a> (from 2010) is a global outlook on web mapping solutions (both client and server).</li> <li>comparison of FOSS libraries by <a href="https://gis.stackexchange.com/users/4972/gcarrillo">German Carrillo</a> can be found <a href="http://geotux.tuxfamily.org/index.php/en/geo-blogs/item/291-comparacion-clientes-web-v6" rel="nofollow noreferrer">here</a>:</li> </ul> <p><a href="https://i.stack.imgur.com/JBs6V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JBs6V.png" alt="enter image description here"></a></p> <p>The list of libraries so far:</p> <ul> <li><a href="http://code.google.com/apis/maps/documentation/javascript/" rel="nofollow noreferrer">Google Maps</a></li> <li><a href="http://www.microsoft.com/maps/developers/web.aspx" rel="nofollow noreferrer">Microsoft Virtual Earth</a></li> <li><a href="http://developer.mapquest.com/web/products/featured/javascript" rel="nofollow noreferrer">MapQuest</a></li> <li><a href="http://leaflet.cloudmade.com/" rel="nofollow noreferrer">Leaflet</a> - "The comment smaller, faster, newer, and more straightforward can also be read as less features and less tested." -Geographika (see below) </li> <li><a href="http://help.arcgis.com/en/webapi/javascript/arcgis/" rel="nofollow noreferrer">ArcGIS API for JavaScript</a> - Works best with ArcGIS Server (see below). <a href="http://help.arcgis.com/EN/webapi/javascript/gmaps/index.html" rel="nofollow noreferrer">Google Maps</a> and <a href="http://help.arcgis.com/EN/webapi/javascript/bing/index.html" rel="nofollow noreferrer">Bing maps</a> extensions are also available, letting you use the ESRI API with Google/Bing maps (though this is true of most libraries).</li> <li><a href="http://developer.yahoo.com/maps/" rel="nofollow noreferrer">Yahoo Map API's</a></li> <li><a href="http://dev.viamichelin.com/" rel="nofollow noreferrer">Via Michelin</a></li> <li><a href="http://openlayers.org" rel="nofollow noreferrer">OpenLayers</a> - Extensive documentation and a good amount of functionality plus the ability to use different map providers. </li> <li><a href="http://mapquery.org/" rel="nofollow noreferrer">Mapquery</a> - MapQuery has been released and now has <a href="http://mapquery.org/docs/" rel="nofollow noreferrer">some useful documentation</a> It has the very worthwhile goal of combining OpenLayers and jQuery. If you're particularly keen on the idea of OpenLayers + jQuery, or if you want to contribute to a JavaScript Mapping Library then get involved and contribute your efforts. However if you just want to be an end user, or are new to this area it may not be for you.</li> <li><a href="http://mapstraction.com" rel="nofollow noreferrer">Mapstraction</a> - Makes things very simple, especially working with multiple basemap providers. However it is still a work in progress and the functionality is lacking in places, as is the documentation. (E.g. "A GeoJSON object with the type “FeatureCollection” is a feature collection object." Not very informative.) It appears that it is still being actively developed but as of 4/4/11 there hasn't been a commit on Github since January.</li> <li><a href="http://developer.decarta.com/" rel="nofollow noreferrer">deCarta</a> - Has a mobile and desktop javascript - first is HTML5/CSS3 compliant and the second has more browser compatibility. Source code provided. Friendliest developer terms for a commercial API. You are allowed to brand the map and there are several different map styles. You can choose NAVTEQ or OSM data. They also have several Mobile APIs as well. - edited by TheSteve0 - a deCarta employee</li> <li><a href="http://cloudmade.com" rel="nofollow noreferrer">Cloudmade</a></li> <li><a href="http://polymaps.org/" rel="nofollow noreferrer">Polymaps</a> - Makes it very easy to composite raster and vector data from many different sources. Lets you easily add your own colouring, grouping, and interaction. Runs quickly, manages background tile loading well, and is only 30k of Javascript. One potential down side: it uses SVG which means it does not and will not work in MSIE 7 or 8. It works great in every other browser and should work in IE9</li> <li><a href="http://eikes.github.com/jump/" rel="nofollow noreferrer">Jump</a> - jump is a light weight maps library that works on its own, meaning, it is not a wrapper for OpenLayers or GoogleMaps API. Currently it is under development, but a lot of essential features work well.</li> <li><a href="http://modestmaps.com/" rel="nofollow noreferrer">ModestMaps</a> - Another smaller, faster, newer JS mapping library from the makers of Mapbox and TileMill. </li> <li><a href="http://pdietrich.github.com/mapiator/" rel="nofollow noreferrer">Mapiator</a></li> </ul> <p>OpenLayers is the one I am currently using. You can do a lot with it and it supports most data types. However it's not the best for everything. For example, Leaflet seems smoother in many ways, with image fading and other visual tweaks. If you're into jQuery you might like to check out MapQuery which is like a combination of jQuery and OpenLayers.</p>
Find points within a distance using MySQL { "id": 31628, "title": "Find points within a distance using MySQL" } 31628 13 68416 <p>I have a mySQL table with user name, latitude and longitude of the user. I would like to get a list of user who are inside the circle or square of a given latitude and longitude with given distance. For example my input Lat= 78.3232 and Long = 65.3234 and distance = 30 miles. I would like to get the list of users who are inside 30 miles distance from the point 78.3232 and 65.3234. Is it possible to solve this with single query? Or can you give me a hint start solving this query? I am new to the geo based information.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment