texts: Custom, low-level representation of streets and traffic rules

texts:
I'm new to GIS, and I'm still trying to gain an understanding of what can be represented in the various GIS files.  Very generally I know(/think) that you can represent points, that lines, polylines, and polygons can be built from these points, and that any of these items can be associated with attributes that have enumerated, string, or numeric value.  (Have I got this right?)

For my current application, I would like to create a customized, low-level representation of a traffic network which will be used in conjunction with a driving anomaly tool.  (It's a government contract to create a framework in which anomalous driving is identified from video.)  In my following pseudo-implementation, please help me spot my misunderstandings and offer advice about how to accomplish what I want.

lanes These will be represented as polylines with a type attribute set to lane.  Lanes includes both marked/permanent lanes as well as unmarked/transient lanes like you would find in an intersection.  Lanes will have other annotations such as name, speedlimit.  Lanes will have directionality based upon the order of the points in their polyline.
intersections These will be represented as a set of lanes. (Can I group things like this?).  Intersections will also be associated with unique identifiers.

Also, should I be considering the difference between GML, Shapefile, etc.  Or can I assume that they will all give me approximately the same ability to represent things.


texts:
From an issue with buffer overlaps, there was this weird problem occurring with an intersect not matching up with the buffers in ArcGIS Pro as shown below:

Upon opening the same exact buffer, with same layer coordinate system, same buffer width, buffer source points, etc. I found that the two softwares were viewing them different as shown below:

In the image above, the buffers were loaded into ArcMap 10.3 (left) and ArcGIS Pro (right). Why is this happening? All of the properties of the layers are exactly identical, but there are clearly some discrepancies. How can I fix this?


texts: Calculating cell size for raster when analyzing area not at equator using ArcGIS Desktop

texts:
How do I calculate the 'correct' cell size for a raster when analyzing an area not at the equator?

My goal is to project a land cover raster provided in GCS WGS84 to an equal area projection and 'accurately' calculate the area in hectares.

The land cover layer metadata (accompanying text file) states that it has a 300 m resolution, by which I assume they mean 300 m equivalent at the equator. Manually measuring the cell size near the equator seems to indicate that this could be true. However, my area of interest is centered on 15 North Lat., 96 East Long. and therefore each projected cell will cover a slightly different area.

The issue arises when I choose the cell size while projecting to equal area.


texts: Need software to read geo information from tif

texts:
I am trying to verify the lat/lon and ECEF values that I have determined for a very specific and unusual situation (a geotif file), and it would be great if I could find some software to read them.

What software can I use that will just open a tif and show me its ECEF and lat/lon corners ? (open source or trial)


texts:
I want to create shadow of a building at different time in ArcScene but I am a beginner of using ArcScene so I am not familiar with this. I am using ArcGIS 10.2.2 version.

I tried to use "sun shadow volume tool" in "visibility" in "3D analyst tool" but the shadow cannot present in different time and in animation.

After that, I found some reference on the internet, it is using "Skyline" and "Skyline barrier" tool to create shadow of the building.
However, I am not understand how to define the position of the Sun and also how to create an animation to present the shadow in different time. Or can I do this?


texts: Displaying click results in a side panel

texts:
I am trying to do something similar to the interactive choropleth map (http://leafletjs.com/examples/choropleth.html) on leaflet's website.

In my case I want to use a click instead of a hover and want to show the results in a side panel (i.e. separate div).

Can someone point me to an example or suggest how I can do this?

UPDATE:
Based on Bronco's reply:

That part I understand. It is this snippet that I need to change but I don't know how:

var info = L.control();

info.onAdd = function (map) {
this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info"
this.update();
return this._div;
};

// method that we will use to update the control based on feature properties passed
info.update = function (props) {
this._div.innerHTML = 'US Population Density' + (props ? '' + props.name + '
' + props.density + ' people / mi2'
: 'Hover over a state');
};
info.addTo(map);


texts: Is it possible to have Google Maps hide the left panel?

texts:
I found that just using the "ll" and "z" parameters are enough to zoom in on an area, but I couldn't find how/if Google can be told to hide the left panel ("Get Directions", "My Places", etc.) so that users see a full map when visiting a URL:

http://maps.google.com/maps?ll=54.868705,-1.593018&z=9

Is there a way?


texts: ArcMap 10.1 convert layer to CAD - clipping only desired area to send out to DWG

texts:
Is there a way to covert a layer to DWG such that only the desired area of the layer is exported out to a DWG?  My issue is that the layer (parcels) contains all parcels for an entire county, so it is a huge amount of information to convert to DWG.  The conversion seems to just freeze up and will not complete.  I actually only need a small area (a few parcels) that I'd like to have in DWG format.  Is there a way to clip or outline a specific area for export to DWG?

Thanks very much for any suggestions.

Rob


texts: Using if statement in Google Earth Engine?

texts:
I'm new to GEE and and having problems to create an if statement with .contains().

Using I let the user create a point in the map using onClick. I have a polygon layer with fire areas. If the point is within the polygon I want to change a text in my panel probably using text.set({value: 'evacuate'}) and if not, nothing changes.

I've been trying to use the ee.Algorithms.If() but doesn't really know how it works. I probably don't know how the .contains() works either.

My code:

 var text_containsfire = ee.Algorithms.If(closest_fires.contains(point), title2.set({value:'Evacuate'}), print('check if false'));
 print('activate', text_containsfire);

closest_brandomrade is the fire polygon as .geometry().

point generated from onClick.


texts: Where are WMX connection files (JTC) stored?

texts: I know that JTC files are SDE connection files with the extension changed from 'sde' to 'jtc'. They are not stored in the folder with the normal sde connection files. Where do they get stored?


texts: QGIS macOS Installer Version 3.2 and Python 3.6, Mac OS Mojave

texts:
I downloaded QGIS version 3.2 and (I think) followed the install directions correctly: first I installed Python 3.6 from the Python website, then I installed GDAL, but when I install QGIS I get the errors mentioned elsewhere in the forum, "QGIS requires Python 3.6".  From reading other posts, it seems like installing Python directly from the Python website was the solution to others with the same error - this may have corrected incorrect paths.

Any thoughts on what else I can try?


texts: How do I label US state borders in ArcMap 10.1?

texts: I'm trying to label a border between TN and NC, but the label manager won't let me. How can I get it to work? I'm using ArcMap 10.1


texts: Reprojecting from multiple USNG coordinates?

texts:
I cannot find a CRS description for the USNG to reproject coordinates that look like this: YD307682. YD denotes a square within the grid zone 48Q (Vietnam). There are thousands of those coordinates, and all of them in 48Q-P, 49Q-P grid zones.

I searched for "USNG" and "MGRS" (Military Grid Reference System) on Spatialreference.org. I looked through PROJ documentation. I did many Google searches.

Ideally, I need the description of USNG in Proj string or an EPSG code, stuff that GeoPandas package in Python works with. But if this is not possible, solutions outside of the box are welcome too.

I am a social scientist, cartography is fascinating, but not my field at all.


texts: Setting "Definition Expression" to StreamLayer?

texts:
How to set "Definition Expression" to a StreamLayer where the data is not coming from an ArcGIS Server Stream?

I try with the following method streamLayer.setDefinitionExpression("field='value'"); but doesn't work.


texts: tools and ETLs for migrating data benchmarking - from shapefile to SQL SERVER

texts: i need to migrate my shapefiles to my database SQL SERVER, and i don't know what's the best tool or ETLs to choose, i already tried FME Desktop and i succeded to load the shapefiles on my db, but while searching i found other tools (like : artend, data migration tool kit, ETL integrator, Scriptella ...). Now i am confused, i don't know what to choose amoung many open source and licenced solution. Plz help.


texts: Showing lowest value first after one-to-one spatial join with delimiter?

texts:
After a spatial join (one-to-one) in ArcGIS my result looks like this: (I use a / as delimiter)

  2015/2015/2014/2014/2013

After that i use python in calculate field to filter out duplicate values in the field:

def removeDup(Field, delim):
   strList = Field.split(delim)
   strSet = set(strList)
   str = delim
   conStr = str.join(strSet)
   return conStr

removeDup(!Years!, "/")

So the result looks like this:

  2015/2014/2013

Now I want to sort the values ascending in the field so it would look like this:

  2013/2014/2015

Any ideas on how to accomplish this?


texts: How to add the mapview layers in Leaflet maps in r shiny app?

texts:
server <- function(input, output){
output$map <-renderLeaflet({
df_data <- uploadshapefile()
...
df_data <- as.data.frame(df_data)
    df_data@data$

id <- nrow(df_data)
    lm.palette <- colorRampPalette(c("red","white","blue","blue4"), space = "rgb")
    m <- mapview(df_data, zcol="quadrant",
            col.regions = lm.palette(20), map = NULL,
            main = "Local Moran's I", pretty = T)
 })
 output$clustered_map <- renderLeaflet({
      m <- m()
      m@map
    })
}

This is the server part of my app, here I cannot get the mapview properly. i.e. I cannot view the base layers with my map. there is no base layers in my leaflet mapview but zoom in, zoom out and panning data is possible. I also followed this link. But no use. I want to get the solution.


texts: QGIS Heatmap values change when imported into ArcMap?

texts:
I am creating a heatmap layer from QGIS and importing the TIFF into ArcMap. When I import the file into ArcMap I notice that values are different.

For example the max value in QGIS is 8.92454, but after I add the same layer to ArcMap the max value becomes 21.8739.

Does anyone know why this is so? Do I need to convert the TIFF into another format before adding to ArcMap?


texts: Find QGIS 3 plugin folder location with PyQGIS

texts:
Background of my question: I would like to figure out the version of a plugin ('my_plugin'), in PyQGIS 2 like:

from qgis.utils import findPlugins
import os

plugins = list(findPlugins('C:\Users\me\.qgis2\python\plugins')) + list(findPlugins(os.environ['QGIS_PLUGINPATH']))
for p_name, p_info in plugins:
    if p_name == 'my_plugin':
        print(p_info.get('general', 'version'))

This works too in PyQGIS 3, except from the path where the plugins are stored (in QGIS 3 plugins are stored in the newly introduced user profiles, and from the GUI, the current plugin folder location can be accesses like described in this post: QGIS 3 Plugin folder location)

after some research my first idea was

from qgis.core import QgsUserProfile, QgsUserProfileManager
current_profile = QgsUserProfileManager().userProfile()
current_profile_folder = current_profile.folder()

... but current_profile is None.

So my question is: How to find the current user profiles plugin location using PyQGIS?


texts: ArcGIS Javascript Click Returning Invalid Coordinates

texts:
I am using ArcGIS Javascript SDK 3.17 to display some points on a map, and when the user selects the point it takes them to Google Maps driving directions.  The points are displaying in the correct location but when I click the graphic it sends some weird coordinates to Google Maps such as -8622416.7705,4523370.1646

Here is my code for the click event:

map.on("click", function (evt) {
   var lat = evt.mapPoint.x.toString();
   var lng = evt.mapPoint.y.toString();
   window.location = "comgooglemaps://?daddr=" + lat + "," + lng + "&directionsmode=driving";
});

Why is this not working?


texts: Save line geometry as points geometry using PyQGIS

texts:
I have line and polygon layers. I want to make a list of points' coordinates (ends or begginings of lines), which are touching the polygons. The coordinates which I need are selected as yellow.

With the code I have right now I get coordinates of the whole line. How to change it? Here is the part of the code and visualisation of my result:

lineFeatures = lines.getFeatures()

lakes = []

for lineFeat in lineFeatures:
    lineGeom = lineFeat.geometry()
    polygonFeatures = polygons.getFeatures()

    for polygonFeat in polygonFeatures:
        polyGeom = polygonFeat.geometry()

        if lineGeom.touches(polyGeom):
            lakes.append(lineGeom.asPolyline()[0])
            lakes.append(lineGeom.asPolyline()[1])

The points in the pictures are there just for visualization. In my project, I have only lines and polygons.
I am working with QGIS and Python.


texts:
I have a webpage, on which I am running Openlayers to query a WMS server.

Now, I want to provide my own data to Openlayers. I do not want to use a WMS server. I have a php script, which will generate tiles in png format, and I want to display them in Openlayers. The reason for not going with WMS is that I have 6 or higher dimensional data, and I will make two dimensional projections thereof, and I want Openlayers to treat this as a map.

How do I feed data to openlayers? I asked this question in the IRC, and also looked on the Internet. I didn't find much.


texts: How do I overlay `.mbtiles` tiles on my Google Maps Object?

texts:
I have a Linode server where I'd like to upload custom-tiles-that-cover-USA-only.mbtiles. I also have script.js on the server, which has this basic code for loading a Google Maps object and putting it on the page.

    var mapWrapperElem= document.getElementById("mapWrapper");
    map=                new google.maps.Map(mapWrapperElem, /* {Object with  GMaps options}*/);

When a user navigates their browser to my server, I'd like the .mbtiles tiles to load on top of my GMaps object. Maybe using the ImageMapType function? How do I get .mbtiles tiles on top of a GMaps object?


texts: ST_Intersection not returning all intersecting geometries

texts:
I have a query that will calculate the proportions of given columns based on the area of intersection. The  returns mostly the polygons entirely inside the other polygon, and in some cases returns the ones that intersect. Why is it not returning polygons entirely inside AND those bisected by the boundaries of another?

SELECT
    ROW_NUMBER() OVER () AS my_new_id,
    st_intersection(a.geom, b.geom)
into newlayer
from mass_pop_censustract as a, mass_regions as b

EDITED: The query should return the bright green plus the areas in the blue hatch (right picture). Essentially, I want to calculate the proportion of the population that lives in the portion of the census tracts (yellow) that falls in my area of interest (light green, left picture.)


texts: Problems with Python in QGIS 2.14 on UBUNTU 14.04

texts:
So far, I have not been able to install correctly QGIS on Ubuntu 14.04. I have tried with different versions of QGIS, different repositories, different tutorials, but I have always had the same issue about Python:

  Couldn't load plugin 'processing'

  AttributeError: 'module' object has no attribute 'GRIORA_NearestNeighbour'
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 281, in loadPlugin
      import(packageName)
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/init.py", line 29, in
      from processing.tools.general import *
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 28, in
      from processing.core.Processing import Processing
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 48, in
      from processing.algs.qgis.QGISAlgorithmProvider import QGISAlgorithmProvider
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py", line 107, in
      from RasterLayerStatistics import RasterLayerStatistics
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/algs/qgis/RasterLayerStatistics.py", line 36, in
      from processing.tools import raster
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/share/qgis/python/plugins/processing/tools/raster.py", line 30, in
      from osgeo import gdal
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/local/lib/python2.7/dist-packages/osgeo/gdal.py", line 83, in
      from gdalconst import *
    File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)
    File "/usr/local/lib/python2.7/dist-packages/osgeo/gdalconst.py", line 86, in
      GRIORA_NearestNeighbour = _gdalconst.GRIORA_NearestNeighbour
  AttributeError: 'module' object has no attribute 'GRIORA_NearestNeighbour'

  Python version: 2.7.6 (default, Oct 26 2016, 20:33:43) [GCC 4.8.4]
  QGIS version: 2.14.3-Essen Essen, exported

  Python Path:
  /usr/share/qgis/python
  /home/jos/.qgis2/python
  /home/jos/.qgis2/python/plugins
  /usr/share/qgis/python/plugins
  /usr/lib/python2.7
  /usr/lib/python2.7/plat-x86_64-linux-gnu
  /usr/lib/python2.7/lib-tk
  /usr/lib/python2.7/lib-old
  /usr/lib/python2.7/lib-dynload
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages/PILcompat
  /usr/lib/python2.7/dist-packages/gst-0.10
  /usr/lib/python2.7/dist-packages/gtk-2.0
  /usr/lib/pymodules/python2.7
  /usr/lib/python2.7/dist-packages/ubuntu-sso-client
  /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
  /home/jos/.qgis2//python
  /usr/share/qgis/python/plugins/fTools/tools

For these reasons I can't use the plugins of QGIS.

Any ideas on how to resolve this issue?


texts: What is a UK boundary shapefile available for download via persistent URL (for cURL) with parish-level detail?

texts:
I'm in the process of generating a series of choropleth maps for a journal article and am writing this up in R as an .Rmd. My aim is to set this up as reproducible research, that is in a form which can be executed and recompiled by other users. Towards this end, I'm looking for a UK (or ideally Scotland) shapefile with LAU2 level administrative boundaries (i.e. local parishes) that can be downloaded directly to R. I'm already doing this for various CSV POI files using getURL() as shown below:

ecs <- read.csv(text=getURL("http://datashare.is.ed.ac.uk/bitstream/handle/10283/1943/ECS-GIS-Locations_2.9_simplified.csv"))

So I'd like to find something similar which is available as a persistent URL ideally from a reliable repository.

The OS BoundaryLine data would be great, except that it sits behind a request form that has to be filled out and then a download URL is provided via email. As discussed on a related thread, GADM and Natural Earth are terrific resources, but AFAIK don't provide parish or county-level boundaries. Can anyone recommend an alternative, but nonetheless canonical / reliable alternative?


texts: Creating ArcPy scripting tool with dropdown box for sql expression choice

texts:
I am creating an ArcPy scripting tool to allow users to select a feature from a feature layer and then zoom to that selection. I have successfully created this tool and now am working on creating the parameters.

I want the user to be able to view a dropdown list of the allowable selections (taken from a field within the attribute table of the feature layer). I currently have the parameter set as a sql expression- however this would require the user to type in more information than they probably know. How can I create a populated dropdown list for the parameter that will correctly input the sql expression? I have attached my code below.

import arcpy
Selection = arcpy.GetParameterAsText(0)
mxd = arcpy.mapping.MapDocument("CURRENT")
dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0]
arcpy.SelectLayerByAttribute_management("PLSS.lyr","NEW_SELECTION", Selection)
dataFrame.zoomToSelectedFeatures()


texts: Mapping values by Census Tract - California

texts: I was able to map values by county in California, but I am trying to map by census tract. I downloaded the census tract file from census bureau and it shows 8,041 values. For the values, I pulled in the census block. How do I get the census block to match up to the cb_2017_06_tract_500k shapefile? The values in this attribute table are StateF, CountyFP, TractCE, AFFGEOID, GEOID, NAME, LSAD, ALAND, and AWATER.


texts: How to plot multiple markers on a leaflet map?

texts:
If I have a object containing lats and longs how can i plot them in leaflet using the marker constructor I tried looping through them

for(key in obj){
            var val = obj[key];
            var markers = new L.Marker([val.lat, val.long]);
            map.addLayer(markers);
        }

but its not showing up in the map

var obj ={
 0 : {
        lat: 15.606562000000000
        long: 32.513681000000000
    },
1 : {
        lat: -12.09137
        long: 34.7182
    }
}


texts: Extract raster values for polygons in GRASS

texts:
I have recently moved to using GRASS for GIS within R and I would like to extract values of a raster dataset that overlap with polygons (i.e. something like 'extract' in the raster package of R).

I can perform my task for spatial points as follows:

execGRASS("r.what", flags="n", map="temperatureRaster",  Sys_input=paste(x, y, site, sep=' '), separator=",", intern=TRUE)

However, I have spatial polygons not spatial points. Eventually, I would like to calculate a mean value for all raster cells whose centroid overlaps with each spatial polygon.


texts:
I am trying to get elevation graph with the Terrain profile tool on my GPS data and can't get it to work. I have GPX file from a drive. I got this imported in QGIS. I have elevation data for each point but when using the Terrain profile tool over this GPX file or the derived shape file, all I get is a flat graph.
I have also tried converting my points shp to line shp file using the point to path in the toolbox but when doing so, I am loosing the elevation data
Anybody can describe the steps to use effectively the point elevation data to create a profile graph?


texts: Unable to change the layer unit in QGIS?

texts:
I have been working with QGIS for 2 weeks and I got the hang of it now.

The problem now is that I cannot calculate the area of a created polygon?
The layer unit is not changing to meters when changing from degrees to meters; it just jumps back?

How to fix this problem?


texts: How do MODIS products naming conventions work?

texts:
If I have the product MOD13Q1.A2014001, does it represent the previous 16 or the 16 days after January 1st?

I.e., the product is made with 16 days, but how to determine if it was taken the previous or later 16 days?


texts: How to add WMS layer in OpenLayers from GeoServer?

texts:
How to overlay a WMS layer from GeoServer (localhost)in OpenLayers?

What is the basic syntax of a GeoServer WMS layer?

Details are as follows:

workspace name: india
layer name:hospitals

 <script defer="defer" type="text/javascript">
 var map = new OpenLayers.Map('map');
 var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "labs.metacarta.com/wms/vmap0";, {layers: 'basic'} );
 var twms = new OpenLayers.Layer.WMS( "World Map", "localhost:8080/geoserver/wms?service=WMS&version=1.1.1& request=GetCapabilities&",
 {
     map: 'hospitals',
     transparent: 'true',
     layers: 'hospitals'
 } );
 map.addLayers([wms, twms]);
 map.zoomToMaxExtent();
 </script>


texts: Get tag/feature/landuse meta information for latitude longitude in openstreetmap

texts:
I need the possibility to find the underlying ground information of a given location (set by latLng) - not an area!

I already tried the nominatim reverse search, but it lacks the landuse information. Here's an example query: http://nominatim.openstreetmap.org/reverse?format=json&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1

How do I enforce the output of the landuse here, which would likely be "residential"?


texts: Create fake clustered raster data in ArcGIS

texts:
I'd like to create several polygon grids with fake species occurrence (see example image)

where each grid cell has a random value between 0 and 5 but high and low values cluster in certain areas as shown in the image.

I've tried the random raster and points tools but they do not cluster sufficiently as they are designed to create random patterns. Any ideas how this can be achieved apart from manually selecting and populating the attribute table of a grid?


texts: Download OSM tiles footprints as a layer

texts:
Is it possible to download a shape layer (or similar) with the OSM tile bounds from somewhere? Not the actual tiles, but only their polygon representations (for example-some area have about n tiles in zoom 17 and these are n polygons in a layer with x,y and zoom number as attributes)?

It's important to know how to get the tile names and footprints (in different scales between 7 and 17 zoom level) in a bounding box. I read a lot and nowhere was explained or given info as an opportunity to get some layer or WFS or similar data protocol...


texts: Problem with datacube UI when I work with new dasaset added

texts:
I installed datacube from the official guide https://github.com/ceos-seo/data_cube_ui/tree/master/docs including the example. Everything works. I tried for simplicity to add a new app that calculates the NDVI even though I already knew it was present. The newly added app works on the example provided by the official datacube guide but does not work on the new data set I entered. When I click on submit the following error appears

  There was an unhandled exception during the processing of your task".

What does this mean?


texts: Are searchable maps limited to geocoding APIs like Google

texts: My client wants a searchable map. I'd like to use Leaflet and Mapbox for the map, but is having an address-search feature limited to  geocoding APIs like Google Maps or Mapquest?


texts: python qgis 2.4 : display a view with symbology

texts:
I have managed to display a view created using postgresql from qgis using python code:

uri = QgsDataSourceURI()
uri.setConnection("localhost", "5432", "stat", "postgres", "admin")
uri.setDataSource("public", "view2", "the_geom", ' ', "gid")
uri.uri()
qgis.utils.iface.addVectorLayer(uri.uri(), "allcountries", "postgres")

Now I want to display this view with symbology (classes), I searched a lot but it was not clear.
For example: I tried to do it with:

myVectorLayer = QgsVectorLayer("polygon", "mypoly", 'ogr')
myTargetField = 'code'
myRangeList = []
myOpacity = 1
# Make our first symbol and range...
myMin = 0.0
myMax = 50.0
myLabel = 'Group 1'
myColour = QtGui.QColor('#ffee00')
mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol1.setColor(myColour)
mySymbol1.setAlpha(myOpacity)
myRange1 = QgsRendererRangeV2(myMin, myMax, mySymbol1, myLabel)
myRangeList.append(myRange1)
#now make another symbol and range...
myMin = 50.1
myMax = 100
myLabel = 'Group 2'
myColour = QtGui.QColor('#00eeff')
mySymbol2 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol2.setColor(myColour)
mySymbol2.setAlpha(myOpacity)
myRange2 = QgsRendererRangeV2(myMin, myMax, mySymbol2, myLabel)
myRangeList.append(myRange2)
myRenderer = QgsGraduatedSymbolRendererV2('', myRangeList)
myRenderer.setMode(QgsGraduatedSymbolRendererV2.EqualInterval)
myRenderer.setClassAttribute(myTargetField)

myVectorLayer.setRendererV2(myRenderer)
QgsMapLayerRegistry.instance().addMapLayer(myVectorLayer)

This gives me an error:

  mySymbol1.setColor(myColour) AttributeError: 'NoneType' object has no attribute 'setColor'


texts: Time Enabled Polygon Shapefiles in ArcGIS Online

texts:
I have a polygon shapefile with 150 features. The shapefile has 10 columns of data, each representing a year. I would like to do a simple time slider Choropleth in an AGOL map to explore changes in these values over the 10 years.

I transposed the shapefile so now I have 1500 features, each one representing a polygon in a given year. I am now able to make the layer 'time-enabled' and upload it AGOL. When loading the feature layer in to a map it fails to render due to the size of the dataset (1500 features). Is this the right approach? It seems inefficient to have a replica of the polygon geometry for every year.

I also feel like that it is unlikely that AGOL wouldn't be able to handle this kid of task and am sure I have seen examples where far larger quantities of data have been represented over time.


texts: Suppress labeling of features smaller than not working properly

texts:
In QGIS there is the option to not label features shorter than a certain value:

("Suppress labeling of features smaller than")

The max. value I can set for the length is 99,99mm. So if I want to supress labeling of features smaller than 0.5m I cannot choose 0,5m as value.

As a workaround I use this expression which works fine:

case when $length>0.49
then MyTextColumn
END

Is it possible that the value I can set for this option means length(on my screen or on my sheet of paper) at a certain scale? This would be very misleading as I think for a scale on a screen I would expect to set a value in Pixel.


texts: Raster math between image collection and image in GEE - use .map function?

texts:
I am currently working with a raster file which shows peatlands in the Congo Basin and the ESA/CCI/FireCCI/5_1 image collection (images for each month between 2001-2019). My end goal is to create visual thumbnails of seasonal (blocks of 3 months) burn area over the peatlands and charts, as well as derive inter-annual trends between the same three months across all years.
Current challenge: I have tried to use the multiply operator between the fire image collection and the peatlands image and it doesn't work between an image and an image collection. I am trying to create a new  fire image collection over the peatlands only.
A pixel value of 1 indicates peat in the peatlands image and I have reclassified the fire image collection so that 1 indicates  land cover that has been burnt.
Annotated code developed so far below:
//Add layers

GretaMap_extent = ee.FeatureCollection("users/n/Vector_peats");//vector of extent of peatland map
PeatlandMap_Greta = ee.Image("users/n/peat_nopeat"); //peatland map

// Visualize FireCCI51 from 2001-2019
var dataset = ee.ImageCollection('ESA/CCI/FireCCI/5_1')
                  .filterDate('2001-01-01', '2019-12-31')
                  .filterBounds(GretaMap_extent)
                  .map(function(image){return image.clip(GretaMap_extent)}) ;

print(dataset);
var burnedArea = dataset.select('LandCover');//all burned pixels are classified according to LandCover

//Palette for Burn Area
var baVis = {
  min: 0,
  max: 180,
  palette: [
    'ffff64', 'aaf0f0', 'dcf064', 'c8c864', '006400', '00a000', '003c00', '285000', '788200',
    '8ca000', 'be9600', '966400', 'ffb432', 'ffdcd2', 'ffebaf', '009678', '00dc82'
  ]
};

//Palette for peatland map
var peatlandsvis = {
  min: 0,
  max: 1,
  palette: ['white', 'fuchsia']
};
//only keep pixels with a value of 1 (peat)
var onlyPeat = PeatlandMap_Greta.updateMask(
  PeatlandMap_Greta.neq(0) // Only keep pixels where values don't equal zero
);

//visualize peat and burn pixels together
Map.setCenter(30, 0, 6.1);
Map.addLayer(burnedArea, baVis, 'Burned Area');
Map.addLayer(onlyPeat, peatlandsvis, 'Peatlands Map');

//Reclassify the LandCover because I'm only interested in the burn pixels, not their land cover
var reclassify = function(image) {
  return image.remap(
    [0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 170, 180],//land cover values
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//recode all to 1
    null,//mask out all other values, which shouldn't exist anyways
    'LandCover');//band name
};
var new_ds = burnedArea.map(reclassify);// new variable which applies reclassification to burnedArea
print(new_ds);
Map.addLayer(new_ds);//I think this worked. Not sure?

//Now: how to only show fire on peatlands?


texts: Radiometric, reflectance and atmospheric correction for Landsat 8 image

texts:
I am struggling with the pre-processing process for landsat8 imagery.

I want to use some indices (e.g. NDVI, SAVI, EVI, NDMI) and create a land cover map at the end using ENVI and ArcGIS.

As a first step, I could download Landsat8 OLI/TIRS C1 Level-1 data from the USGS website.
However, I am not sure whether this data is required to do radiometric/reflectance/atmospheric correction. The file name is LC08_L1TP_StartDate_EndingDate_01_T1_Band# Data value is maximum 60,000, and the minimum value is all 0 except Band12 (Figure).

I read some website (https://landsat.usgs.gov/using-usgs-landsat-8-product) but still very unclear about what I really need to do.


texts: Creating fishnet along linear feature in ArcGIS Desktop?

texts:
I want to create square grid of polygons along a polyline(Road). Assigning spatial extent of the polyline will create grid squares not containing the line as well.

Do I have any other options ?


texts: Offset multiple overlapping lines or display it parallel in QGIS

texts:
I have an Issue to display overlapped Lines in Parallel, first the overlapped Lines share the same row in Attribute Table (see picture).

Any idea? This is the Lines:


texts: I am building pipes network, I need check connection between of pipes. I want to pipes must snap and tolerance has value = 0. Is there any tool to check and fix this things. I know Topology Checker Plugin, but this plugin is not limit about tolerance.


texts: Extract elevation values from WMS DEM to points

texts: I have a points feature class that I am trying to get elevation values for the state of texas. ArcGIS Online conveniently has a DEM for the entire state as a WMS. I am wondering if there is a way to extract the elevation values from the WMS to a field in my points feature class. In QGIS I have tried using the point sampling tool but it does not seem to recognize the pixel values in the WMS. When I id a pixel the elevation is displayed through an html element. Is there any possible way to extract this value?


texts: What kind of improvement can be done for raster tiles for mobile usage

texts:
We generate raster map tiles and deploy them in the server, then we use javascript in the client to request the tiles and re-organize them to map.(like google map and Openstreetmap).

However this is the PC solution. And the tile size is 256x256(pixel) with 96dpi.

Now we want to build apps in android and iOS.

However we found that the same 256x256(pixel) tile will have a different visual  effect in devices with different resolution and the tile is almost unreadable in a high-resolution device(The text and labels in the tile is too small).

Then I wonder how do you make the tiles readable in the mobile device, is there any way to improve them?


texts: GeoJSON layer on Google Maps API is not showing


texts: Loading OSU's Ocean Productivity on QGIS

texts:
I've been trying to work with OSU's Ocean Productivity layers for a while now, but I can't get it open on QGIS. These are "*.hdf" (HDF4) and I've successfully opened and worked with them on ArcGIS in the past using the Marine Geospatial Ecology Tools (MGET), but I haven't had any success with QGIS yet.I don't have access to ArcGIS anymore, so MGET is no longer an option, and I need to find a way to vizualize and work with these on QGIS.
The open button should work for this as it has HDF4 as a file type, but it doesn't. I think it doesnt work because the coordinates are not in a known file type. On ArcGIS, MGET is used to make that conversion, but I do not know how to do it in QGIS.

Can anyone help me with inputting these hdf files into QGIS?

The info available on the FAQ page at OSU is as follows:

These hdf files are in an Equidistant Cylindrical projection.

The rows represent lines of latitude, and the columns coincide with longitude.

For 1080 by 2160 data, the grid spacing is 1/6 of a degree in both latitude and longitude.
1080 rows * 1/6 degree per row = 180 degrees of latitude (+90 to -90).
2160 columns * 1/6 degree per column = 360 degrees of longitude (-180 to +180).

The north west corner of the start of the hdf file is at +90 lat, -180 lon.

To obtain the location of the center of any pixel:
- take the number of rows and columns you are away from the NW corner,
- multiply by the grid spacing to get the change in latitude and longitude,
- subtract the change in latitude from +90 lat,
- add the change in longitude to -180 lon;
- shift the latitude down (subtract) by 1/2 of a grid spacing
- and shift the longitude over (add) by 1/2 of a grid spacing

This gives the center of any pixel. To get the NW corner of any pixel, do not shift over and down by 1/2 of a grid spacing.


texts: GPX Track Information - time stamp of track

texts:
I'm working with *.gpx data to see how long certain bus lines are and to have a time stamp from bus stop to bus stop. So, I know I can import these tracks into QGIS quite easily, but when I do this, the information about the time it takes the bus from stop to stop is lost. Now in addition I work with a gpx track editor, where I can see the information I need.

But, as this editor works with a basemap where not all stops are shown (as it is a rather rural region of Austria and the stops are often not good to see) I wondered if there is a way to import a shape of the stops I need?

Has anyone of you experience with gpx track editors and knows a way to import any kind of file besides *.gpx or rather can I save my point layer of stops as gpx?


texts: Creating atlas along line/route in QGIS?

texts:
I have a geological map and I want to represent the geology of a new 100 km road. The 100 km fit well in a (for example) 1:250.000 scale map, but I want to represent it at a 1:25.000.
In map composer the coverage layer is my (for example) road.shp. The idea is that the different sheets follow the road (and rotate) all time. The number of sheets should be fixed by the scale (in that case, 1:25.000), but if you want to change the scale this numbers should change.
The attached picture shows the result of the “grids for atlas plugin -> Generate dynamic grid”. It’s a very close result of my propose but no rotation in the grid.

How can I prepare a coverage layer as much automatic as possible where the rotation is defined by the road and the scale is defined by “scale” in map 0?

(As I did manually in the second screenshot)

I'm trying to prepare atlas following a line or a rute. I follow the instructions of How to create a customizabe table in QGIS Print Composer? but  there are two problems:

The map follow a line but do not rotate. The north is always up.
The scale varies from map to map and it's determined by the number of segments (created with v.split.length tool) of your line but not controlled in map composer -> main properties -> scale.

Any solution ?


texts: How to edit a table in order to count the number of points in the same location?

texts:
Using QGIS, I have a point shapefile that has multiple points with same coordinates across different locations.

I need a count of those points.

For example there are 15 features that have the exact same coordinates in location A, and there are 12 features that have the exact same coordinates in location B. A very useful result would be maybe to have a new shapefile with location A 15 and location B 12

I have a column with postcodes (though there are postcodes with different spatially distributed points) and columns with coordinates if it helps.


texts: I am using ArcGIS maps and trying to follow JS API. I am trying to understand how can I add a protractor on the map which will help in angles while drawing polygons. I understand I could add a Feature layer but how do I add an image to it? How can I make the protractor movable, without it being scale up/down with the map?


texts: Access WFS with authentication from PyQGIS

texts:
I struggle with accessing  a WFS (Cyclomedia Atlas Recordings) with the following code from a PyQGIS plugin:

import urllib.parse
from qgis.core import QgsVectorLayer, QgsDataSourceUri

wfs_params = {'service': 'WFS',
              'version': '1.1.0',
              'request': 'GetFeature',
              'typename': 'atlas:Recording',
              'srsname': 'EPSG:25832'}
uri = QgsDataSourceUri()
uri.setEncodedUri('https://atlas.cyclomedia.com/recordings/wfs?' + urllib.parse.unquote(urllib.parse.urlencode(wfs_params)))
uri.setUsername('me')
uri.setPassword('my_password')
cyclom_photos_lyr = QgsVectorLayer(uri.uri(), 'Cyclorama Locations', 'WFS')

The relevant parts of the WFS' capabilities response look like this (it's password protected):

<ows:Operation name="GetFeature">
  <ows:DCP>
    <ows:HTTP>
      <ows:Get xlink:href="https://atlas.cyclomedia.com/recordings/wfs"/>
      <ows:Post xlink:href="https://atlas.cyclomedia.com/recording/wfs"/>
    </ows:HTTP></ows:DCP><ows:Parameter name="resultType">
...
<wfs:FeatureTypeList>
  <wfs:Operations>
    <wfs:Operation>
      Query
    </wfs:Operation>
  </wfs:Operations><!--
<wfs:FeatureType>
  <wfs:Name>atlas:Recording</wfs:Name>
  <wfs:Title>Recording</wfs:Title>
  <wfs:DefaultSRS>EPSG:4326</wfs:DefaultSRS><!--NAD83-->
  ...
  <wfs:OtherSRS>EPSG:25832</wfs:OtherSRS><!--ETRS89-->
  ...

I am not using the uri directly as described in the documentation (https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/loadlayer.html) because I'm not aware of passing credentials to the service directly via uri, therefore the QgsDataSourceUri().setUsername()... construct.

The above code gives me the following error:

2019-10-08T12:08:54     WARNING    GetCapabilities failed for url user='me' password='my_password' https://atlas.cyclomedia.com/recordings/wfs?service='WFS' request='GetFeature' srsname='EPSG:25832' typename='atlas:Recordings' version='1.1.0' table="" sql=: unexpected end of file
2019-10-08T12:08:54     WARNING    Download of capabilities failed: Protocol "" is unknown

What am I doing wrong or what am I probably missing?

The WFS is accessible via Data Source Manager without any problem (dots in the screenshot below), but I need to add it programmatically for convenience reasons.


texts: Cutting out depth information in raster. Calculating volume in Qgis

texts:
I am trying to calculate habitat volume for around 30 fish stocks in Qgis. I have habitat areas (shape files) and Bathymetric information (.tif file). I believe I can calculate the entire volume of water for each habitat area using the r.volume module in the QGIS Grass plugin (after having clipped the tif file to represent each exact habitat area).

However my problem is is that my fish stocks have a specific depth range. In other words they do not swim throughout the entire volume of water in their habitat area.

My question is. I can calculate the volume of the habitat area from sea level to the floor, but how can I 'cut out' all the volume below and above the depth range of the fish stock. For example if a fish stock has a depth range of 50-200 meters, i want to cut out all the volume above 50 meters and below 200 meters.

Here are the Properties found under the layers, properties --> Metadata

Driver
GDAL provider
GTiff
GeoTIFF

Dataset Description
/Users/aninahenggeler/Documents/Humboldt/Thesis /High seas proposal/GIS & Google Earth/Bathymetry/Grid - geotiff/ETOPO1_Bed_g_geotiff FAO area 27.tif
NC_GLOBAL#Conventions=COARDS/CF-1.0
NC_GLOBAL#GMT_version=4.4.0
NC_GLOBAL#history=grdreformat ETOPO1_Bed_g_gdal.grd ETOPO1_Bed_g_gmt4.grd=ni
NC_GLOBAL#node_offset=0
NC_GLOBAL#title=ETOPO1_Bed_g_gmt4.grd

x#actual_range=-180, 180

x#long_name=Longitude

x#units=degrees

y#actual_range=-90, 90

y#long_name=Latitude

y#units=degrees

z#_FillValue=-2147483648

z#actual_range=-10898, 8271

z#long_name=z

Band 1

NETCDF_VARNAME=z

STATISTICS_MAXIMUM=4208

STATISTICS_MEAN=-1187.2601375688

STATISTICS_MINIMUM=-5808

STATISTICS_STDDEV=1836.8780130609

Dimensions

X: 7035 Y: 3324 Bands: 1
Origin
-48.1083,89.9583
Pixel Size
0.0166667,-0.0166667
No Data Value
0

Data Type

Int16 - Sixteen bit signed integer

Pyramid overviews

Layer Spatial Reference System
+proj=longlat +datum=WGS84 +no_defs

Layer Extent (layer original source projection)
-48.1083333333333201,34.5583333333333584 : 69.1416666666666799,89.9583333333333428
Band
Band 1
Band No
1
No Stats
No stats collected yet

USING RASTER CALCULATOR:

Please see following expression used. Please note this expression created a new raster which appears empty (2nd screenshot below).

"ETOPO1_Bed_g_geotiff@1(@z#actual_range>-200)(-200+50)+(@z#actual_range<=-200)(@z#actual_range>-50)*(@z#actual_range+50)"


texts:
I have just imported a few gps coordinates from a csv file and saved it as a shapefile. Moreover, I have got a vector layer with polygons in this project. Both layers are in EPSG: 32632. The first point has the coordinates 49.465550, 8.47273. If I pan over the layer containing the gps data the coordinates given in the status bar are fine. But if I pan over the the other vector layer it gives coordinates eg 457426, 5481718.

Why are the two coordinate systems different if the two layers have both the same CRS and projection?

Is this the reason why the gps points are awfully off?


texts: Drawing parallel lines inside polygons (Well Paths) using ArcGIS Desktop?

texts:
I would like to take a polygon feature class with multiple irregular polygons, and have Arc draw parallel lines inside of each polygon. Ideally, it would be nice for Arc to figure out the angle of the longest side of the polygon and draw parallel lines to that side, but to keep it simple, I think if I could just enter one angle for all the parallel lines, that would be easier.

So line angle, width between lines, min/max length, and buffer width from the sides of the polygons are what my basic criteria are.

Image attached if that helps.


texts: Using ArcGIS Field Calculator to create classes in new field?

texts:
I first classified firstCol into groups and then I want to give the groups with different weighted values in another field, SecondCol. I will need to give different weighted values very often. I find it very time-consuming whenever I modify the weighted values in my script.

My column looks like this:

I use the following script to calculate the SecondCol:

def TextValue(gridcode):
if gridcode <= 5:
    return 1
elif  5 < gridcode <= 15:
    return 2
elif  15 < gridcode <= 30:
    return 3
elif  30 < gridcode <= 40:
    return 4
elif  40 < gridcode <= 55:
    return 5
elif  55 < gridcode <= 100:
    return 6
elif  100 < gridcode :
    return 7
else:
    return "N/A"

TextValue( !firstCol! )

As you can see, I give the weighted value as below:

(weighted values  ,  group).

1   =   group "firstCol  < 5"
2   =   group "firstCol = 5 - 15"
3   =   group "firstCol = 15 - 30"
4   =   group "firstCol = 30 - 40"
5   =   group "firstCol = 40 - 55"
6   =   group "firstCol = 55 - 100"
7   =   group "firstCol > 100"

I wonder if there is a better way to give new weighted values more efficiently. Like, just give a new column in the beginning of the script.

61  =   group "firstCol  < 5"
8   =   group "firstCol = 5 - 15"
88  =   group "firstCol = 15 - 30"
70  =   group "firstCol = 30 - 40"
52  =   group "firstCol = 40 - 55"
2   =   group "firstCol = 55 - 100"
6   =   group "firstCol > 100"

def TextValue( gridcode):
if ...
...
else...

TextValue( !firstCol! )

Then, the script will use the new values, instead of me modifying it in the TextValue.


texts:
i was wondering if anyone created a ST_GeoHash36 function inside postGIS,

i know the ST_GeoHash + ST_GeomFromGeoHash functions exists,

But i need the geohash36 function inside postGIS, i need a smaller hash:

info:
http://en.wikipedia.org/wiki/Geohash-36

ruby implementation:
https://github.com/clothesnetwork/geohash36

online demostration:
http://geo36.org/bdrdC26BqH-m

Anyone know if this exists?

Txs!

** Solution! **

i made a postgresql function that use the geohash36 script!
works great!

geohash36_encode function:

CREATE OR REPLACE FUNCTION geohash36_encode(double precision, double precision)
RETURNS text AS
$BODY$
#!/bin/sh
echo `/bin/sh /opt/geohash36_coords.sh hash $1 $2`
$BODY$
LANGUAGE plsh VOLATILE
COST 100;
ALTER FUNCTION geohash36_encode(double precision, double precision)
OWNER TO postgres;

geohash36_decode function:

CREATE OR REPLACE FUNCTION geohash36_decode(character varying)
RETURNS text AS
$BODY$
#!/bin/sh
LAT=`/bin/sh /opt/geohash36_coords.sh coords $1 | cut -d':' -f 2 | cut -d' ' -f 2`;
LON=`/bin/sh /opt/geohash36_coords.sh coords $1 | cut -d':' -f 3 | cut -d' ' -f 2`;
echo $LAT,$LON
$BODY$
LANGUAGE plsh VOLATILE
COST 100;
ALTER FUNCTION geohash36_decode(character varying)
OWNER TO postgres;

example:

geohash36_coords.sh code:

#! /bin/bash
#echo $1 $2 $3

if [ $1 = "coords" ]; then
               echo `geohash36 coords $2`
            fi

if [ $1 = "hash" ]; then
               echo `geohash36 hash $2 $3`
            fi

IMPORTANT:
YOU NEED TO HAVE THIS ALREADY INSTALLED :
https://github.com/clothesnetwork/geohash36


texts: Correct interpretation of raster values - bulk estimates

texts:
We are analyzing soil types in order to find suitable sites for afforestation. We would like to know as much as possible about their:

Soil pH in KCl
Cation exchange capacity
Available soil water capacity
Organic carbon stock

SoilGrids rasters we downloaded are: TAXNWRB, PHIKCL_M_sl6, OCSTHA_M_100cm, CECSOL_M_sl6, BDRICM_M, AWCh1_M_sl6, AWCh3_M_sl6

We found the chapter explaining how the estimates were calculated:

  "We generate predictions at seven standard depths for all numeric soil
  properties (except for depth to bedrock and soil organic carbon
  stock): 0 cm, 5 cm, 15 cm, 30 cm, 60 cm, 100 cm and 200 cm, as per the
  GlobalSoilMap specifications Arrouays et al. (2014). In vertical
  dimension we predict at point support i.e. exactly for given depth,
  while in horizontal space the predictions match the support of
  covariates. Bulk estimates of values for standard depth intervals,
  e.g. 0–5 cm, can be further derived by taking an average any pair of
  upper and lower absolute depths, or a weighted average from multiple
  depths." (Source:
  https://github.com/ISRICWorldSoil/SoilGrids250m/wiki/Target-soil-variables)

The stage where we stopped is the understanding the calculation behind the next layers: PHIKCL_M_sl6, CECSOL_M_sl6, AWCh1_M_sl6 and AWCh3_M_sl6.

The thing is, we need the bulk estimate for those layers at depths up to, for instance, 1 meter, but not the values at specific depth. How can we get those values? Should we simply calculate the average between upper and lower depth, like:
(PHIKCL_M_sl1 + PHIKCL_M_sl6)/2 to get the bulk estimation for the depth range up to 1 meter?


texts: Getting SyntaxError from ArcPy Select by Layer?

texts:
I am currently wondering what is the fastest way of using Select By Attributes in arcpy.
I have a GDB with a feature class that is quite big. This feature class has a field called CODE with values of type LONG.

I want to select 3 types of these features, namely the ones that have either 5020, 5601 or 8002 in the CODE field.

I tried running the following code:

SelectByAttribute=' "CODE" = ' 5020 ' OR "CODE" = ' 5601 ' OR "CODE" = ' 8002
arcpy.SelectLayerByAttribute_management("Bat_StudyArea", "NEW_Selection", SelectByAttribute)

I am getting a syntax error, but I am too blind to find the error.


texts: Where is the Numerical Digitizing Plugin?

texts: I know this question has occurred before, and quires have been speculated about its existence. However, the only questions I can find about it are all regarding out dated QGIS versions. Does the Numerical Digitizing plugin exist on QGIS v3.2?


texts: Does the version admin workflow change when all users edit the SDE.DEFAULT version?

texts:
An esri blog article (5 Best Practices SDE Maintenance) states, when discussing updating statistics for an ArcSDE, "... in situations where all users are editing just the SDE.DEFAULT version [this is my case], you should just keep the statistics you collected before the compress. This will ensure that the query optimizer knows the delta tables are still active."

What does this mean? Does this mean I should not run the Compress tool prior to running the Analyze Dataset tool, but to do so only afterwards? This does not follow the maintenance workflow described here: Recommended version administration workflow (ArcGIS Help).


texts: Add RGB values from CPT file to Int16 GeoTIFF using Python and Gdal

texts:
I want to add color, using RGB values stored in a CPT file, to a black and white Int16 GeoTIFF file using Python.

I tried to use SetColorEntry(), but when I add the ColorTable to the RasterBand, I get the following error:

ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.

The GeoTIFF is a bathymetry where the values range from -5000 to 50. Using Byte or UInt16 would result in a lot of data loss

Can someone help me out and point me in the right direction?


texts:
In Esri's documentation on how to make a prediction in Kriging, I couldn't figure out the linkage between the semivariograms and the prediction process from reading the description therein:

  After you have uncovered the dependence or autocorrelation in your
  data (see Variography section above) ... you can make a prediction
  using the fitted model. Thereafter, the empirical semivariogram is set
  aside.

  You can now use the data to make predictions. Like IDW interpolation,
  kriging forms weights from surrounding measured values to predict
  unmeasured locations...

Still, that doesn't say much about how kriging forms weights.

Is it true that we're just using a different set of weight values than the 1/distance in IDW?

If Kriging really just uses a different weight values than IDW, how can it solve the well-know summit problem for IDW? (whereby IDW cannot predict a higher value outside the range of the control points. e.g. One cannot correctly predict the elevation of a peak in a terrain based on lower elevation values of nearby data points.)

I understand the semivariogram measures average dissimilarity for a given separation distance, and the values are all non-negative.

Can someone explain how the combination/weighting method (e.g. with linear regression or any other variant) on a computed semivariogram works to solve the "summit" problem?


texts:
There is a problem on my system when starting QGIS. I get this error. I am running openSuse Tumbleweed 64bit and openSuse 12.3 64bit. Same problem on both systems.

Couldn't load PyQGIS.
Python support will be disabled.

  Traceback (most recent call last):   File "", line 1, in
  RuntimeError: the sip module implements API v10.0 but the qgis.core
  module requires API v9.2

  Python version:
  2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]

  QGIS version:
  1.8.0-Lisboa 'Lisboa', exported

  Python path: ['/usr/share/qgis/python', '/home/evert/.qgis//python',
  '/home/evert/.qgis//python/plugins', '/usr/share/qgis/python/plugins',
  '/usr/lib/python27.zip', '/usr/lib64/python2.7',
  '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk',
  '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload',
  '/usr/lib64/python2.7/site-packages',
  '/usr/lib64/python2.7/site-packages/FontTools',
  '/usr/lib64/python2.7/site-packages/PIL',
  '/usr/local/lib64/python2.7/site-packages',
  '/usr/local/lib/python2.7/site-packages',
  '/usr/lib64/python2.7/site-packages/gtk-2.0',
  '/usr/lib/python2.7/site-packages',
  '/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info',
  '/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode']

The problem would seem to be the API version implemented in the sip module versus the API version implemented in the qgis.core.

How do I go about fixing the problem once and for all, as it has been a recurring problem on various occasions over the years.

My apologies if this question has been asked and answered here already. Did do a search but could not find this specific problem.

                       ------Edit------------

Used Yast to install Qgis, Grass ect, after adding the required repo's.

<URL: http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.3/
Category: YUM>

<URL: http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.3/
Category: YUM>

There is listed in the Geo repo develepment versions of both Qgis 2 and Grass 7. I have not installed them at any time on either system.


texts:
I need to do some HTTP request based on feature in PyQGIS.

Based on http://zetcode.com/pyqt/qnetworkaccessmanager/ I created this class:

from typing import Callable

from PyQt5.QtNetwork import  QNetworkAccessManager, QNetworkRequest
from PyQt5.QtCore import QCoreApplication, QUrl
from PyQt5.QtGui import QIcon, QPixmap
from qgis.core import QgsMessageLog

class HttpGetPhoto:
    photo_id: str = None
    callback: Callable = None

    def __init__(self, photo_id: str, handleResponseCallback: Callable):
        self.photo_id = photo_id
        self.callback = handleResponseCallback

    def doRequest(self):
        url = f'https://example.net/photos/{self.photo_id}.jpg'
        QgsMessageLog.logMessage(f'Making a request to {url}')
        req = QNetworkRequest(QUrl(url))

        self.nam = QNetworkAccessManager()
        self.nam.finished.connect(self.handleResponse)
        self.nam.get(req)

    def handleResponse(self, reply) -> None:
        #er = reply.error() -> treat error :
        QgsMessageLog.logMessage(f'Err ? {reply.error()}. Reply message : {reply}')
        pixmap = QPixmap()
        pixmap.loadFromData(reply.readAll())
        self.callback(img)

I get the "Making a request to https://example.net/photos/XXX.jpg but I never get the response. am I missing something ?


texts: KML file seems to load in Openlayers without error but doesn't show vectors

texts:
I'm trying to load a KML file into an Openlayers map. It seems to successfully run but I am not seeing anything show up on the map.

Vectors should show up in an area of New Mexico if it's working correctly.

Here is my code (here is a link to the KML file )

var map;

var baseMaps = [];
var sensors = [];

//create map and center over location
var init = function () {
    // create map

    map = new OpenLayers.Map({
        div: "map",
        theme: null,
        projection:new OpenLayers.Projection("EPSG: 4326"),
        controls: [
            new OpenLayers.Control.Attribution(),
            new OpenLayers.Control.TouchNavigation({
                dragPanOptions: {
                    enableKinetic: true
                }
            }),
            new OpenLayers.Control.Zoom()
        ],
        layers: [
            new OpenLayers.Layer.OSM()
        ]
    });

    map.setCenter(new OpenLayers.LonLat(-106.7653, 32.3197).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()),9);
};

//show kmlFile
var showSensor = function(sensorVO)
{
    if(sensorVO.selected == true)
    {
        var kmllayer = new OpenLayers.Layer.Vector("KML", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: sensorVO.url,
                format: new OpenLayers.Format.KML({
                    extractStyles: true,
                    extractAttributes: true,
                    maxDepth: 2
                })
            })
        });

        map.addLayer(kmllayer);
        var select = new OpenLayers.Control.SelectFeature(kmllayer);
        map.addControl(select);
        select.activate();

        map.setCenter(new OpenLayers.LonLat(-106.639261,32.649908).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()),10);

        var obj = {"vo":sensorVO, "kmlLayer":kmllayer};
        sensors.push(obj);
    }

    else
    {

        for (var i = 0; i < sensors.length; i++)
        {
            var vo = sensors[i].vo;
            if(vo.id == sensorVO.id)
            {
                map.removeLayer(vo.kmlLayer);
                sensors.splice(i, 1);
            }

        }

    }

}

init();

setTimeout(function(){
    var obj = {"id":1, "selected":true, "url":"kml-files/1858-Vegitation-Map.kml"};

    showSensor(obj);
}, 1000);


texts: Extracting Total Block Count or Intersections for given city or list of cities?

texts:
I am currently trying to count the total number of blocks in a given city without manually counting them by hand.

Is there a way to query the total count of block numbers  in some programming language ( I think ArcGIS uses Python) for a given city or list of cities ,so that the output would be as below

    City      Total Number of Blocks
Manhattan      12563

Or even more granular per city from list.

  City = Manhattan

Block#      GPS Coordinates
1           56.6767,79.485748
...         ....
12456       56.6754,79.476776

In this photo from ArcGIS, which is a screenshot of a map of Manhattan, it outputs the the address number of each block .

You should be able to see the numbers "54" Chambers Street , "68" , "270", "35"

I have looked at this past question that was asked 3 years ago, but was unable to solve it with their recommendations.
Counting road intersections
"Extracting all intersections from polyline shapefile using QGIS? "

I am not an expert at all.

I am using a trial license of ArcGIS Desktop.

Vector Dataset Update Per @FelixIP

I have found a website that allows me to get a vectorized dataset BBBIKE

Supported Output Formats for BBbike

 - They have a "pro version" which allows one to get metadata associated with the "extract"


texts:
In my situation:
I have a CSV file with information about specific road segments: Road number, start kilometer, end kilometer.

And I have road shapefile with Road numbers.

The task is to create a layer only with road segments. I used ArcGIS Desktop but now I need to solve this task with QGIS.

Is there any alternative in QGIS for ArcMap tool "Make route event layer"?

The tool creates a temporary feature layer using routes and route events.


texts:
I have only one vector layer on my map, and it's not letting me select some polygons. For instance, this is what happens when I try to select a certain polygon (the yellow outline with the blue star inside it).

Those polygons aren't missing or anything-- when I fill them in, everything gets filled correctly:

Why can't I select this polygon?


texts: UTM to lat/long conversion using arc length formulae from library

texts:
Most of the descriptions I have seen for converting Lat/Long into UTM have some method of estimating ellipse arc lengths mixed into the formulas (e.g. see http://www.linz.govt.nz/geodetic/conversion-coordinates/projection-conversions/transverse-mercator-preliminary-computations/index.aspx) .

I want to be able to use the arc length formulas provided by a separate library.  Can anyone point me to a description of Lat/Long -> UTM conversion which just treats the ellipse arc length formulas generically without specifying a particular estimation method?  I'm not clear on what is the GIS stuff and what is the ellipse stuff with these methods.


texts: How to programmatically identify landmarks (cemeteries) in Google Maps satellite data?

texts:
I'm searching Google Maps satellite view for cemeteries that are not listed in common repositories of cemeteries.  I've spent a lot of time cruising around satellite mode searching for small cemeteries within a county.  I'd like to figure out a way to programmatically identify cemeteries within a given boundary.  I'm not sure if there's a way to provide a set of training images & then have a program 'crawl' a defined area to identify areas that are likely cemeteries.  For example, the following link shows an example of what the program would identify:
https://www.google.com/maps/place/35%C2%B036'29.7%22N+76%C2%B052'35.0%22W/@35.60825,-76.8785687
Does something like this already exist?


texts:
I have, for a while, been trying to make a terrain map using NASA's SRTM 3 dataset. I have a large (13 GB), geotiff projected to web mercator of all the elevation files provided. I have been able to make a color-relief Geotiff based on this one. The color-relief file was made in ~1 hour.

The problem I have is that the when I try to use the hillshading it is painfully slow, and produces around 50MB an hour, on a file that I suspect will be around 20GB. (which will take 10 days+)

I have come to a point where I might just let it run in the background for the time needed, but since we have power-outages somewhat frequently from people overloading the stove, this doesn't really seem feasible!

The command I am using is

os.system("gdaldem hillshade -compute_edges  -combined -of GTiff -co BIGTIFF=YES -co compress=lzw -co predictor=2 -co TILED=YES -z 3 D:/gdal/rebase.tif D:/gdal/hill_projected.tif")

I have tried setting --config CACHE_MAX and wm, but they don't seem to bite, and the gdaldem process is still only using ~2% of the availabe memory.

I have also tried setting --config GTIFF_NUM_THREADS=ALL_CPUS which didn't speed up the task either.

I have tried to split the hillshading up to different regions, to later combine them to export to tiles, but run into the same problem in the eurasia and islands region.


texts: How to get a legend for a WMS layer and search in it?

texts: How to bring legend and search for WMS layer in QGis? I can see the WMS layer in Qgis but can't make any legend for identifying feature types and searching in WMS layer?


texts: How to draw ploygon in leaflet that use event?

texts:
Is there only one way to draw a polygon through the Leaflet.draw plugin?

If you want draw anything, you must add the control ("map.addControl(drawControl);").

I want to draw a polygon on leaflet map by Event that I can trigger through any DOM event. Does anybody have a good idea how I can do this?


texts: Identifying road intersections from an axial map

texts:
I am doing an analysis of number of road intersections per sq km. The idea is to both identify actual road crossings that are controlled with traffic signals (found on roads with higher speed) but also road intersections of streets that have 30 kph speed or lower and are designed in such a way that it would be easy for pedestrians to cross even without there being a traffic signal.
This is what I've done so far:

I have an axial map of roads and I used a plugin called Place Syntax Tool to create junctions where each line intersects another line. (photo 1)
To highlight the junctions that are on 30 kph roads I used another vector layer (not axial map) with roads limited to 30 kph and I buffered these roads enough that they intersect with the junction points. Then I selected only the junctions which intersected with the buffer and saved them on a new layer. (photo 2)

The problems:

Axial maps represent sightlines, so if a street is curved in reality, on the map it can consist of several line segments that intersect with each other, so on some streets more junctions are created than there are intersections in reality. I guess in order to get around this I need some kind of tool that would select only the junctions created by 3 or more line intersections?
Im still missing the road crossings regulated with traffic signals on higher speed roads.

My project area is a relatively small municipality so I could potentially solve all this with several hours of manual editing with the help of google maps or similar. However, I was wondering if there are any ideas of how to automatize this in qgis and improve my method?


texts: How to replace a directory using QGIS Field calculator?

texts:
I have a column called Hotlink full of incorrect directories and I need to edit them.

They currently read C:/ABCD/filename.pdf and I want them to read C:/Maps/ABCD/ABCD/filename.pdf

The script I'm trying to use but not having much luck with is as follows:
replace
 ("Hotlink", '(ABCD)', '(Maps/ABCD/ABCD)');

How can I get this to work?


texts: How to reduce large dataset for processing by Tippecanoe and upload to Mapbox

texts:
I'm a masters student at the University of Washington without any background in geo, so if this question seems naive or unclear, I apologize. Please let me know if I can add any information for clarity.

I'm working on a data visualization project and my subject is streamflow data. I'm attempting to display streamflow over a map produced with NHDPlus flowline data, which shows the location of all the rivers and streams in a given region. I've chosen HUC 17, the PNW, because I'm trying to render in the browser and working with data at the national level looked unwieldy.

I've come around to a vector tile approach as the best option for performance and interactivity. The shapefile, when converted to GeoJSON, weighs in at 438MB. To try and break that up I've found and am trying to use Tippecanoe, a tool for producing vector tiles from huge datasets. It works as advertised. It's awesome. Very easy if you're comfortable on the command line. The trick is that to upload these tiles to mapbox.com, where I could, ostensibly, view and style the tiles, each tile must be less than 500k and contain no more than 200,000 features.

I would like to know how to slice and dice the data in such a way that I can get it up to mapbox, or, how to work with the tiles locally using something like tilelive?


texts: QGIS 3.18.2 Print Composer/Layout map legend vanishes/goes blank when layer/theme is changed

texts:
Using the print composer/layout in QGIS 3.18.2 I have the following problem ...
Starting point:
I had a print layout set up with a map and legend. The map layers were set by 4 themes. The layout used an atlas. I printed all those maps as expected.
Now:
I have made a new theme. When I set that theme in the "Follow map theme" option, the display of the Legend on the page vanishes/goes blank (it is still there as an object and the item properties are editable in the panel ... and I have tried clicking on/off many of the settings to try alter its behaviour, to no avail).
The same thing happens when I change the layers in one of the themes that had worked/printed correctly with a legend functioning properly.
If I uncheck "Follow map theme" on the main map the blank legend problem persists.
If I change the theme back to the original, the legend functions as expected.
If I create a new legend, I can use the new theme ... but now I have recreated the styles 3 times and that is getting a little old and tiring for every time I change a layer/theme! ha
Help!
Has anyone encountered this and/or know how to fix this issue/know what might be causing it in my project?
Legend settings:

Update:
Unfortunately the problem has occurred in a layout in a completely different project. Perhaps the problem is with my QGIS program and not the layers or layout itself?


texts: Add a heatmap as a layer to a map based on OpenStreetMap from C# WPF Visual Studio 2013

texts:
I need to show a map with some points (with lat/lon) of a heatmap on a map based on OpenStreetMap (OSM) .

I have created a heatmap as a bitmap image by GHEAT.NET control lib http://www.codeproject.com/Articles/88956/GHeat-NET.

I would like to add the heatmap image to a map based on OSM so that the points on the heatmap can be shown on the correct locations by latitude/longitude on the map of OSM.

I am working on C# VS2013 WPF. In my C# code, I used OSM control lib GMAP.NET at:

http://greatmaps.codeplex.com/

This is my C# code:

System.Drawing.Bitmap myCanvasImage = new System.Drawing.Bitmap(12 * 256 - (2 * 256), 15 * 256 - (5 * 256),        System.Drawing.Imaging.PixelFormat.Format32bppArgb)
System.Drawing.Graphics g = Graphics.FromImage(myCanvasImage);
gheat.PointManager myPoints = new gheat.PointManager();
var xrange = Enumerable.Range(2, 12);
var yrange = Enumerable.Range(5, 15);
foreach (int x in xrange)
{
   foreach (int y in yrange)
   {
     System.Drawing.Bitmap tempImage = gheat.GHeat.GetTile(myPoints, "classic", zoom, x, y);
     g.DrawImage(tempImage, new System.Drawing.PointF(x * 256 - (2* 256), y * 256 - (5 * 256)));
   }
}

I need to add the "myCanvasImage" (the heatmap) to a map based on OSM.

I have checked "gmap-net-tutorial-maps-markers-and-polygons"

But, there is no "GMapOverLayer" class in GMAP.NET WPF.

I have also checked the "heatmap-with-osm" on oms help forum.

But, the solutions there do not work for we. I need to do heatmapping on C# WPF Visual Studio 2013 for desktop applications.

Leaflet and openlayers are javascript libs for web/mobile applications.

Also, MapSurfer.net requires  .NET Framework 4.5 and Microsoft Visual C++ 2012.

OsmSharp is for routing on map.


texts: Rendering graph generated by MakeGraph using ArcPy?

texts:
The arcpy MakeGraph_management tool suggests that a graph is stored via an in_memory representation that can be either:

added to the host app or
saved using SaveGraph_management.

The graph appears to be stored in a manner similar to an in_memory layer, e.g. in_memory/<name>.grf.

In the case of an in_memory layer, it is possible to add the layer to the map (ToC).  I can not find documentation describing how to programmatically add the .grf (an instance of the arcpy.Graph() class) to the map.  I am interested in having the graph remain interactive - so I am not using arcpy.mapping to add the graph to a map element.

Does anyone have documentation that describes how to render the graph generated by MakeGraph?


texts: Getting the center point of a cluster in Pandas


texts:
I have around 200 Geo-referenced JP2 files that I want to add to ArcMap. Out of these I want to create a single Mosaic raster.

However, I'm having issues adding the data.

Everything is fine for the first 100 files or so, after that, whenever I want to add more, it just stalls. I've managed to add around 150 files, but now, the add data button doesn't show the connected folders. The folders were working before, since I did managed to add 150 files.

Any ideas around this, it just looks as if ArcMap can't deal with that many raster images in bulk.

I use ArcGIS Desktop 10.3.1


texts: Can't get Geoserver running on my computer

texts:
I downloaded and installed Java SE Development Kit 7u71 and Apache Tomcat (since JDK7u71 contains JRE, so I didn't download Java SE Runtime Environment 7u71). No problem with Apache Tomcat. Then I downloaded and installed GeoServer 2.6.1 (Windows Installer,Run manually), the wizard found automatically the JRE path: C:\Program Files\Java\jdk1.7.0_71 (I checked it, there is a JRE file in jdk1.7.0_71). After this I tried to run GeoServer,but it didn't work.

I then checked Environmental Variables, there was no JAVA_HOME, so I added it with value C:\Program Files\Java\jdk1.7.0_71. Then I restarted my computer, GeoServer still  didn't work. Then I changed ‘GEOSERVER_DATA_DIR’ system variable to C:\Users[MY USER NAME HERE]\AppData\Roaming\Geoserver\data_dir, and restarted my computer, still, GeoServer did not work.

What could be the problem? How can I make GeoServer work? Any help?


texts: How to fix Graphserver warning "osmdb has no edges!"?

texts:
I'm really new to GIS.

I have some shapefiles data that I'm trying to import in graphserver. I'm doing:

gs_osmdb_compile output3.osm output3.osmdb

And the result is: WARNING: osmdb has no edges!.

I'm using a shapefile that may not be ready for import. I'm converting it to OSM, then I'm trying to import it using gs_osmdb_compile. I guess they are related to the v.net function in GRASS, but I'm not sure to understand what should be the end result.

Thank you very much!


texts:
I am currently interested in any kind of GIS Information about Netherlands. I need it for some kind of research. Such informations as temperature, soil composition, precipitation, elevation are very interesting for me.

Also, I would be interested in any kind of railway infrastrukture data, such as traffic intensity, noise, track age and so on.

My question is, if there are any of the mentioned data available and how to export them to (for example) Excel. Until now I have been working with ESRI ArcGIS product family (ESRI ArcGIS for Silverlight API and ESRI ArcGIS .NET SDK). So if you mentioned some service, please give me some advice how to use it (of course if you know how).


texts: How to get properties from gx_mappanel layers

texts:
I have gx_mappannel with id:mappannel. I added two layers to this panel: OSM layer and one vector layer, here is the sample code:

          Ext.onReady(function(){
              ...
              {
                xtype: "gx_mappanel",
                ref: "mapPanel",
                id:"mappanel",
                region: "center",
                title: 'my title',
                map:{
                    maxExtent: extnt
                    numZoomLevels:zomlevel,

                    projection: myprojection,
                    center:theCenter
                  },

                 layers:[new OpenLayers.Layer.OSM(),

                       vlayer= new OpenLayers.Layer.Vector("vlayer",
                           {
                            projection:myprojection,
                            strategies:[new OpenLayers.Strategy.Fixed()],
                            protocol:new OpenLayers.Protocol.HTTP({
                                url: "mygeojson",
                                format: new OpenLayers.Format.GeoJSON()
                            }),

                          })

                     ]
             },
            .....
        }

I checked that the two layers are added to the pannel using this code

           myPanel = Ext.getCmp("mappanel");
           console.log(mapPanel.map.layers.length);

The console prints 2, and that is right.

The vector layer produces geojson data of the form

"features":[{"geometry":{"coordinates":[938423.3125,6653195.5],"type":"Point"},"type":"feature","properties":{"count":7}},{"geometry":{"coordinates":[903914.25,6653195.5],"type":"Point"},"type":"feature","properties":{"count":7}},{"geometry":{"coordinates":[888329.5625,6644321.5],"type":"Point"},"type":"feature","properties":{"count":5}},....

I want to iterate over the vector layer and calculate sum of the "count" values. I mean this one-("properties":{"count":7}). I made some tries but not successful yet.

Can any one help?


texts: How to install 3rd party python libraries for QGIS without OSGeo4W on Windows?

texts:
I want to install pip package in QGIS. I have tried the standard windows installation from Windows command line as explanined in pip site, but still can not import pip from QGIS Python console. I have read the following question but I use standalone installation for QGIS and have no OSGeo4W installation.

How to install 3rd party python libraries for QGIS on Windows?


texts: Choosing Shapefile attribute data type to use?

texts:
I am trying to figure out when to use (in the Data Type of SHAPEFILE PROPERTIES) - TEXT - SHORT-INTEG - LONG-INTEG - FLOAT AND DOUBLE.

I am using ArcView 9.3 and I know when it is all text or use the date or if it is all numbers what to use.

But, when it is "2N" or "7.5" or "7%" which and what do you use?


texts: Prepending string to name of raster output using ArcPy?

texts:
Right now my script searches for rasters, reprojects the raster, and replaces the extension with jpg.

My output looks like a list of rasters named fm-4-65.jpg. , fm-4-66.jpg, etc.

How could I make it so that the code adds "test_" to the output raster file name so that the resulting name looks like test_fm-4-65.jpg?

Here is my code:

import arcpy, sys, os

InFolder = r"C:\test_in"
OutFolder = r"C:\test_out"
OutSR = arcpy.SpatialReference(26918) # NAD83 / UTM zone 18N

arcpy.env.workspace = InFolder

rasterList = arcpy.ListRasters()
for Ras in rasterList :
     inRaster = os.path.join(InFolder, Ras)
     spatial_ref = arcpy.Describe(inRaster).SpatialReference
     if spatial_ref.type <> "Unknown":
          outFileName = "{}.{}".format(os.path.splitext(Ras)[0], "jpg") # Remove .sid and add .tif to Ras filename
          outRaster = os.path.join(OutFolder, outFileName) # Path and Filename of output raster (.tif)
          arcpy.ProjectRaster_management (inRaster, outRaster, OutSR)


texts: Regular expression substring for labelling

texts:
I downloaded OSM .pbf raw data for Germany. Right now I'm trying to create label badges for german highways. German highways have names starting with the letter 'A' followed by a number with up to three digits.

In my dataset the information about the highway name is stored in a column called "other_tags" alongside with other information looking like this:

"bdouble"=>"yes","maxspeed"=>"none","oneway"=>"yes","ref"=>"A 7","surface"=>"asphalt"

I want to extract the 'A 7' diregarding the rest of the string. I thought about using regular expressions to do so (QGIS actually has this feature -> GREAT!), however I'm stuck implementing it without failing.

This is what I've tried using a custom expression for 'Label with':

regexp_substr( other_tags ,'A\s[0-9]+')

My understanding of the regexp implementation is:

regexp_substr('string to analyze', 'regular expression output')

However, since that does not work I could need some help on building the expression.


texts: Sites with recreational shapefiles for United States?

texts:
Do you know of any sites that I could find some recreational shapefiles?

An example would be shapefiles of golf courses, ski resorts, or maybe baseball fields in the United States?


texts:
I installed MapServer 7 and I need phpmapscript.
Is there any binary package for phpmapscript for Debian Stretch? I could install PHP 5.6 from binaries (https://stackoverflow.com/questions/46378017/install-php5-6-in-debian-9) but I cannot find phpmapscript binary package.
Should I compile from sources?


texts: Other users unable to use ArcGIS Python script tool in shared folder?

texts:
I created a new toolbox with a script tool that successfully works for me when I run it. I have it saved in a shared folder that my coworkers can access but when they try to run it, it doesn't work. One coworker gets an error message that says they can't locate the Python script even though when they checked the properties it showed the correct file and when another coworker runs it, it stuck in a loop and nothing happens.

I have no idea why it works for me but no one else.


texts: Can't upload files to database by Nominatim

texts:
I was trying upload geofabric's netherlands-latest file into Nominatim's database. I used bellow command and all was fine:
./utils/setup.php --osm-file maps/netherlands-latest.osm.pbf --all 2>&1 | tee setup.log
But suddenly, I got the following error:

Processing: Node(100308k 215.7k/s) Way(13517k 25.85k/s) Relation(107730 1210.45/s)  parse time: 1077s

Node stats: total(100308187), max(3651340162) in 465s
Way stats: total(13517172), max(360615308) in 523s
Relation stats: total(107736), max(5369205) in 89s
node cache: stored: 100308187(100.00%), storage efficiency: 58.77% (dense blocks: 70357, sparse nodes: 49312332), hit rate: 100.00%
Stopping table: planet_osm_nodes
Stopping table: planet_osm_rels
Stopping table: planet_osm_ways
Building index on table: planet_osm_rels (fastupdate=off)
Building index on table: planet_osm_ways (fastupdate=off)
Stopped table: planet_osm_nodes in 0s
Stopped table: planet_osm_rels in 0s
CREATE INDEX planet_osm_ways_nodes ON planet_osm_ways USING gin (nodes)  WITH (FASTUPDATE=OFF);
 failed: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

Error occurred, cleaning up
ERROR: Error executing external command: /opt/Nominatim/osm2pgsql/osm2pgsql -lsc -O gazetteer --hstore -C 2002 -P 5432 -d nominatim /opt/Nominatim/maps/netherlands-latest.osm.pbf
Error executing external command: /opt/Nominatim/osm2pgsql/osm2pgsql -lsc -O gazetteer --hstore -C 2002 -P 5432 -d nominatim /opt/Nominatim/maps/netherlands-latest.osm.pbf

I didn't find any definite answers.

I've tried changing the order of installation. First, I've started
./utils/setup.php --create-db --setup-db --create-functions --create-tables
Second, I started import through osm2pgsql like:
osm2pgsql/osm2pgsql -s -S osm2pgsql/default.style -C 2000 -U postgres -d nominatim -k -c --number-processes 2 maps/netherlands-latest.osm.bz2 and got there http://pastebin.com/Fpfsv2xv


texts: Why does Geoserver WMS not work in GeoExt?

texts:
Geoserver URL

{http://localhost:8090/geoserver/Test/wms?service=WMS&version=1.1.0&request=GetMap&layers=Test:B901_AS&styles=&bbox=638500.0,5309500.0,639000.0,5310000.0&width=512&height=512&srs=EPSG:4326&format=application/openlayers}

HTML code

<title> A Basic GeoExt Page </title>

<link rel="stylesheet" type="text/css" href="ext-3.4.0/resources/css/ext-all.css"></link>

<link rel="stylesheet" type="text/css" href="GeoExt/resources/geoext-all-debug.css"></link>

What is the problem? Pls help me.


texts: How is the center calculated in this Openlayers 3 example?

texts:
I've seen the demo of auto tracking (when clicking simulate) http://openlayers.org/en/v3.2.1/examples/geolocation-orientation.html and tried to copy it.

and I want to modify the code and place the marker on different places on the screen (in the center for example).

I know the "magic" is done in this function :

var getCenterWithHeading = function (position, rotation, resolution) {
var size = map.getSize();
var height = size[1];

return [
    position[0] - Math.sin(rotation) * height * resolution * 1 / 4,
    position[1] + Math.cos(rotation) * height * resolution * 1 / 4
];

}

But I don't understand how to modify it so the marker will be in the center of the map.


texts: How to create a convex hull using QGIS Geometry Generator?

texts:
Background:
At 3.14.16, I'm trying to learn a little more about Geometry Generator, in this case convex hull.  I created a simple test point layer with six points.  I then used Geometry Generator with the expression convex_hull($geometry), expecting an outline hull to display.  However, none appeared, as shown in the screenshot below.  Only the original points appear.
In my search for a solution, I came across this SE GIS post, where  convexHull($geometry) was successfully used.  Unfortunately, that expression did not result in a outline for my points.
Question:
How do I display a convex hull around a point layer using Geometry Generator?


texts: PostGIS R-Tree: Why does it exist when PostgreSQL already implements its R-Tree with what appears to be the same algorithm?

texts:
PostGIS implements its R-Tree algorithm via PostgreSQL's GiST. But PostgreSQL already implements its R-Tree and the logic appears almost identical to that PostGIS is also implementing.

So why are there 2 R-Trees in the PostgreSQL environment?
I can think that it has to do with the fact that PostGIS offers additional data types. But was it really required that PostGIS adds its own (identical) R-Tree algorithm? It looks like redundant code to me (defining the same logic at two points). I can also think that there might have been differences in the past which required this inefficiency, but are they there now and so what would they be exactly?


texts: Calculating distance from centroid points to multiple polygon edges with SpatialLite

texts:
My question builds on a question previously asked (Calculating all distances from single points to multiple polygons). User @alexandre-neto provided an answer that I've worked on, but it isn't giving me the result I need. I'm new to SpatialLite and using QGIS 3.6 on a Windows OS.

I've created a SpatialLite database that has a point and a polygon layer. The point layer is the centroid of a sampling grid and the polygon layer comes from a government database called the 'Vegetation Resource Inventory (VRI)', which includes lots of data on stand age, species composition, wetlands, etc...

I want to create a new layer or a table of distances from the centroid of my sampling grid (Named: "Grid Pothole Center") to the nearest edge of the VRI polygon layer (Named: "Pothole VRI"). It looks like SpatialLite offers a way to do this. I used the following code from instructions on the link provided above:

SELECT
  f.id,
  g.id,
  st_distance(f.geom, st_centroid(g.geom)) AS distance

FROM
 'Grid Pothole Center' AS f,
 'Pothole VRI' AS g

Note: 'Grid Pothole Center' and 'Pothole VRI' have a common field called 'id'. This runs from the SpatiaLite DB manager plugin (select the database and ran the SQL statement above) without any error messages and a result is given. However, I get an empty table x with the following headings: id, id:1, distance - but no data in the table. What have I done wrong here?


texts: Making raster histogram excluding zeros in R?

texts:
In R, can I make a histogram of all the non-zero values in my raster?

Some reproducible data below. I just want the histogram to be made with the zeros. Happy with a way to do that, or I guess to create a new raster that just removes all the zero-cells from r.

y=seq(33,34,.1)
coords=expand.grid(x,y)
rdf=data.frame(coords,depth=runif(nrow(coords),0,2))
names(rdf)=c('x','y','value')
r=rasterFromXYZ(rdf)
plot(r)
hist(r)```


texts: raster2pgsql error: violates check constraint "enforce_out_db_rast"

texts:
When I run the command:

raster2pgsql -s 4269 -a -R -F -t auto path_to_my_file.tif public.agdd_2016 | psql -U postgres -d climate -h server_ip -p 5432 --pass

I get the following error:

Processing 1/1: /geo-data/gridded_models/agdd/agdd_20161021_base_thirtytwo_f.tif
INFO: Using computed tile size: 93x72
BEGIN
ERROR:  new row for relation "agdd_2016" violates check constraint "enforce_out_db_rast"
DETAIL:  Failing row contains (3123162, 0100000100DCC660BBAF7A963FDCC660BBAF7A96BFBD8A315555415FC0000000..., agdd_20161021_base_thirtytwo_f.tif, null, null, null).
ERROR:  current transaction is aborted, commands ignored until end of transaction block

How do I fix this? I have tried running this query on my database:

SET postgis.enable_outdb_rasters TO True;

I have also tried adding the following to /etc/postgresql/9.4/main/postgresql.conf and then rebooting postgres

postgis.enable_outdb_rasters = True

- Update -

I have verified that the following query returns true, but the error in question still persists:

SHOW postgis.enable_outdb_rasters;

I also noticed that if I drop the enforce_out_db_rast constraint, the raster2psql command fails on the next constraint that exists on the table so I'm now not so sure that this problem is specific to enforce_out_db_rast.

This error only started happened after upgrading from PostgreSQL from 9.4.5 to 9.4.10. Before that I was not getting any constraint violations.

select version(); (before and after upgrade)

PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
PostgreSQL 9.4.10 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit

SELECT PostGIS_Version(); (before and after upgrade)

2.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

I'm not sure which version of gdal (raster2pgql) I have but maybe that's where the issue is? I also currently have two server snapshots one pre upgrade and functional and the other post upgrade which exhibits the issues.


texts: Is there a way to make a qgis project only editable by me

texts:
In QGIS, currently Lisboa 1.8.0 is there a way to make it only editable by me.  I want to set up projects for each client on the network, so when all the files are on the network and the program and project are saved on the network that everyone can view it and interogate it but only I can edit layers, add new layers, draw on it, etc etc.

I dont know if this is in the right section or if it is answerable.

I may need to clarify this point i think.


texts:
I have a problem on the development of a python plugin, I'm trying to display the OpenStreetMap map behind layers, only the map is not synchronized with the layers, it can't find it or even the location.
The geographical position of the map does not correspond to that of my layers.
#Vlayer is defined above the code / Vlayer est définie au-dessus du code

urlWithParams = 'type=xyz&url=http://a.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0&crs=EPSG3857'
maplayer = QgsRasterLayer(urlWithParams, 'OpenStreetMap', 'wms')
settings = QgsMapSettings()
settings.setLayers([vlayer,maplayer])
settings.setBackgroundColor(QColor(255, 255, 255))
settings.setOutputSize(QSize(800, 690))

settings.setExtent(vlayer.extent())

render = QgsMapRendererParallelJob(settings)

render.start()
render.waitForFinished()

img = render.renderedImage()
img.save(QgsApplication.qgisSettingsDirPath()+"python/plugins/nro_print/img/render.png", "png")

result:


texts: How to better visualize features of clusters in OpenLayers

texts:
I am using the cluster strategy for mapping a large number of features in OpenLayers, now I would like to find a good solution for providing info about the features contained in a cluster selected by the user. In other words whenever the user selects one cluster I would like to explode the cluster with as many markers as the features contained in it, of course selectable markers.
Could anybody help me?
I attached an image about how the markers around the selected cluster would look like.


texts: SQL Spatial Table and trailing white space issues

texts:
When accessing a table from our MSSQL Server via MapInfo, none of the fields contain trailing white spaces, the same holds true when exported to CSV via MapInfo.

However, when exporting the same table from Management Studio, all the fields have quite a few consistent amount of trailing white spaces, this is causing issues when using the tables in Spectrum.

I have tried doing a field update with the RTrim function in MapInfo but nothing changes.

Any ideas as to why this happens?

PS: Only certain tables exhibit this behaviour.


texts: POST CQL filter (with large geometry) in HTTP body

texts:
The size of an URL is limited. Therefore I'm not able to request a WFS with a complex geometry. I read (Geoserver POST filter to WMS layer) that is possible to do in a WMS, but I didn't get it to work.

I'm using Postman to POST to my geoserver and add raw body data like this:

CQL_FILTER=INTERSECTS(geometry, POLYGON ((0 0, 1 1....))

I also tried it in key-value form type. I also tried url-encoding it first.

Does anyone know how to query with large geometries? (WKT in my case).


texts: Using "schema.clone = True" on Python Toolbox Parameter?

texts:
I have created a few different ArcGIS Python Toolboxes, but one thing I can't quite understand is when to apply "schema.clone = True" to a parameter. All of the examples I have seen show that I should be using it for derived parameters, as shown below, taken from Parameter Dependencies.

# First parameter
param0 = arcpy.Parameter(
    displayName="Input Features",
    name="in_features",
    datatype="GPFeatureLayer",
    parameterType="Required",
    direction="Input")

# Third parameter
param2 = arcpy.Parameter(
    displayName="Output Features",
    name="out_features",
    datatype="GPFeatureLayer",
    parameterType="Derived",
    direction="Output")

param2.parameterDependencies = [param0.name]
param2.schema.clone = True

However, when I try that on my code, it says the Tool is invalid when looking at it in Catalog. It gives me the following error when I click on the "Why..." button.

Traceback (most recent call last):
  File "<string>", line 481, in getParameterInfo
AttributeError: 'NoneType' object has no attribute 'clone'

Here is what my code looks like. It works perfectly when I remove the schema clone line, which is confusing me. What exactly does that line do and when do I need it?

# Input Table
input_table = arcpy.Parameter(
    displayName="Table or Feature Class",
    name="input_table",
    datatype=["GPFeatureLayer", "GPTableView"],
    parameterType="Required",
    direction="Input")
params.append(input_table)

# Derived Output Table
output_table = arcpy.Parameter(
    displayName="Derived Output Table or Feature Class",
    name="output_table",
    datatype=["GPFeatureLayer", "GPTableView"],
    parameterType="Derived",
    direction="Output")
output_table.parameterDependencies = [input_table.name]
output_table.schema.clone = True
params.append(output_table)

I am currently running version 10.4


texts: Can I create a more interactive relationship class for interaction between features?

texts:
Is it possible to be able to click on a point and see interacting tables? An example that I found on Google is this flight route map? http://www.ryanair.com/en/cheap-flight-destinations/

Edit: I am using ArcMap 10.2. I have two feature classes of which I am wondering if I could create an interactive relationship.


texts: Keep leading zeros when converting .txt into dbf using CopyRows management

texts:
I am writing a python code in order to bring my.txt file into a dbf file in arcgis. I am using CopyRows_management which seemed to be working just fine until I realized that one of the 40 fields from the txt file loses the leading zeros of number(it is the only field with leading zeros with  sometimes just one "0", somtimes two "0", sometimes none).
Is there a way to keep these zeros?

Any help will be welcome.

Thanks so much.