texts: Clipping ArcGIS MapServer Map Service using QGIS?

texts:
I’m quite an inexperienced QGIS user (2.18 on Ubuntu 16.04).

I’m working on an irrigation scheme and for that I need some information on the elevation difference between two points.

Luckily, the project is in Wallonia (Belgium) which has a high resolution DEM (http://geoservices.wallonie.be/arcgis/rest/services/RELIEF/WALLONIE_MNT_2013_2014/MapServer).

I managed to get this map into Qgis using the « Add ArcGIS MapServer layer »(encoding png32).

I’m now trying to clip it (so I then can transform it into a point shapefile which would be usable). I can’t use the raster>extraction>clipper option (I suppose it’s due to some map protection). So I tried to « save the raster layer as… » a .tiff image (not creating VRT) using the extend of the land on which i’m working. It doesn’t work either but in a strange way :

First it says that the saving is completed
Then it says that my .tif file is not a supported raster file (which
is quite strange)
Last but not least, it actually doesn’t create any .tif file in the folder I selected

How can I clip this DEM using either a polygon or the map view extent while keeping the original resolution?


texts: Google Maps/ OpenLayers only rendering top left tiles

texts:
I'm seeing a weird issue with Google Maps and OpenLayers. When loading a page as shown below, only the two top-left tiles render, leaving the rest of the map blank.

I looked in the Network tab in Chrome Dev. Tools, and indeed, those are the only two tiles that came down the pipe.

However, once I interact with the map using the mouse in any way, the tiles all come down properly. Rendering the map using Bing or any other provider works fine.

One likely possibility: the map is rendered on a tab widget. If I explicitly load that tab in the URL (e.g. specifying #tab-4), the map renders fine.

Also, I've seen people having this problem when they don't explicitly specify the dimensions of the map div in pixels, but mine is explicitly set.

The behavior is identical in Firefox, IE 9, and Chrome.

Anyone seen this behavior?


texts: Creating shapefile of a raster image in QGIS 3.6

texts:
I use QGIS 3.6 on Windows and I have been trying to convert raster images into shapefiles. I managed to do that for Digital Terrain Models only, using the conversion --> vectorize tool in the qgis toolbar.
An example of images I want to convert into shapefile can be found in this link https://www.uahirise.org/ESP_040921_1985. How do I achieve that?


texts: Extracting coastline as vector from landsat 8 imagery?

texts:
I am trying to detect some sea level rise/fall for a specific region, from Landsat imagery.

I went through the recommended methods of identifying water/land (MNDWI, AWEI, Bandratio 5/2, etc.).

Now I am at the point where I need an accurate vectorized coastline. I tried with Geomatica Lineament extractor, but somehow I wasn't happy with the results.I have Geomatica 2013, ENVI 5.3 and ArcGIS 10.2.


texts: Getting $area from a feature in a processing script in QGIS3

texts:
I've created a complex process, but I'm stuck on one point.
I found this code to find the number of features in a layer.

def processAlgorithm(self, parameters, context, feedback):
    input_featuresource = self.parameterAsSource(parameters,
                                                 'INPUT',
                                                 context)
    numfeatures = input_featuresource.featureCount()

However for my computations I need the area from the one feature that is the input-layer and I can't find any code to do this. Using Python directly I would use something like this:

features = layer.getFeatures()
for f in features:
    geom = f.geometry()
    print "Area:", geom.area()

But is this possible in a processing script?
What is the best way of obtaining the area-value I need?


texts: How to create a webmap/app where a user can select features by location by drawing a polygon?

texts:
I would like to share a simple webapp service with colleagues whereby users can draw polygons on a map and features which intersect their drawn layer are selected and their attributes returned. I've had a look on the ArcGIS online help pages and found this which seems helpful but the URL for the app has expired.

Is anyone able to offer some pointers as to where to begin?


texts: Rasterizing each line features separately in layer using PyQGIS

texts:
I have a vector layer which is consists of channels in a watershed. I want to rasterize each individual line in the layer separately in PyQGIS. I could not manage to loop through in the layer and rasterize. I am trying to do it with gdal:rasterize. I have seen that one can add -where in gdal:rasterize but I still couldn't make it work.
How can I do it?
My goal is to rasterize a channel and use native:rasterlayerzonalstats to get the max for each channel in the layer. Another option is buffering the line layer but I want to rasterize and go that way.
for feat in vlyr_ger.getFeatures():
    objectid = feat['OBJECTID']
    res88 = processing.run ("gdal:rasterize", {
            'INPUT': vlyr_ger,  # already vector layer
            'WHERE': 'OBJECTID='+ str(objectid),
            'FIELD': None,
            'BURN': 1,  # Fixed value to burn
            'UNITS': 1,  # Georeferenced units
            'WIDTH': cellsize,
            'HEIGHT': cellsize,
            'EXTENT': rlyr_demFilled,
            'NODATA': 0,
            'OPTIONS': '',
            'DATA_TYPE': 5,  # Float32
            'INIT': None,
            'INVERT': False,
            'EXTRA': '-tap',
            'OUTPUT': 'TEMPORARY_OUTPUT'})


texts: Route not pointing to the exact location

texts:
I am new at using ArcGIS. I was testing the network analysis part exactly vrp (vehicle routing problem).
I noticed that the route generated is not pointing to the exact location like shown in the image below! The route in blue is not even reaching to the location 2!

Anyone has an idea how to fix this (I am wondering is it due to the network dataset that I have used) or is this normal?


texts: QGis: Natural breaks (Jenks) - algorithm is buggy?

texts:
I don't know how the Natural Breaks (Jenks) algorithm works in QGis graduated symbolism, and I've deliberately not researched it in order to ask this question, as my point is based on what seems to be intuitively wrong, rather than what may be technically correct (but not useful or expected).

So! If you have a range of values and constrain them to a few classes, Jenks does a nice job of splitting up the data:

But if you add further classes, Jenks just repeats the lowest value, often:

Since I don't know (yet - I will now research it) how Jenks works, it'd be remiss of me to say the algorithm is coded "wrongly", however the implementation is peculiar and unexpected. Possibly if it auto-constrained itself to the maximum number of independent classes? Or pooled identical-valued colour bands?


texts: Making lists of nearby points using QGIS?

texts:
I am a new user of QGIS. I have uploaded a csv file to my QGIS map with 500 points and I want to make sets of 10 points (or different amount of points) based on distance.

I want to gather nearby points (based on meter linear distance) grouped by 10 points and have one excel or csv file per set of points (of course each list should not include any of the other points already on another set). Is this possible?

And also if there were 501 points, is there a way to make 1 set of 11 points and the rest of 10 points? I am just using the example of sets of 10 but it would be great to choose any number for the set of points (like lists of 5, 20, 50 points or whatever).


texts: fix self intersecting polygons using ogr2ogr or other open source librar

texts:
I have a shapefile that includes some self intersecting polygons. What would be the easiest way to fix them using open source Python/command line? Is it possible to use ogr2ogr to do this (answers using fiona, shapely, geopandas etc. are also welcome) ? I want to do this because Google Earth Engine cannot handle self-intersecting polygons.

The answer using spatialite seems like a good option, however my GDAL doesn't currently support spatialite functions. I built GDAL using Docker.

ogrinfo --formats sqlite | grep 'spatialite' -i


texts: Converting GeoJson/Shp to Iso-xml (ISOBUS ISO 11783-10)

texts:
How do I convert some geojson/shp files to ISOBUS iso-xml files, ISO 11783-10?

I am having a hard time finding any information.


texts: LegendGraphic gray color from external SLD file

texts:
I'm trying to add legendgraphic from a WMS layer with an external SLD file wich is generated dynamicly. The legend is added but the colors from SLD file are all gray. The WMS layer is colored by SLD filters. In legend the filters are gray.

The code used is:

if(value_selected=="Pret/mp")
            {
            document.getElementById("map").style.width = "90%";
            spatii.mergeNewParams({SLD: "http://127.0.0.1:8080/proprietati/tmpo/<?php echo $identificator; ?>_spatii_pretmp.sld",STYLES: null});
            spatii.redraw(true);
            document.getElementById("legenda").innerHTML = "<img src=\"http://127.0.0.1:8080/geoserver/proprietati/wms?Service=WMS&REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&EXCEPTIONS=application%2Fvnd.ogc.se_xml&WIDTH=14&HEIGHT=14&LAYER=<?php echo $identificator."_spatii";?>&SLD=http://127.0.0.1:8080/proprietati/tmpo/<?php echo $identificator; ?>_spatii_pretmp.sld\" />";

            }
        if(value_selected=="Default")
            {
            document.getElementById("map").style.width = "100%";
            spatii.mergeNewParams({SLD:null});
            spatii.redraw(true);
            }

    }

EDIT
Here is the LOG section from geoserver:

Request: getLegendGraphic
    Strict = true
    Height = 14
    Width = 14
    Locale = null
    Format = image/png
    Rules = []
    Styles = [StyleImpl[ name=proprietati:ro25858_spatii]]
    FeatureType = null
    Layers = [SimpleFeatureTypeImpl http://proprietati:ro25858_spatii identified extends Feature(geom:geom,id_spatiu:id_spatiu,identificator:identificator,id_cladire:id_cladire,info:info,numar_contract:numar_contract,beneficiar:beneficiar,pret_total:pret_total)]
    Env = {}
    Scale = -1.0
    Transparent = false
    Exceptions = application/vnd.ogc.se_xml
    LegendOptions = {}
    Version = 1.0.0
    Request = GetLegendGraphic
    RawKvp = {EXCEPTIONS=application/vnd.ogc.se_xml, REQUEST=GetLegendGraphic, FORMAT=image/png, VERSION=1.0.0, SERVICE=WMS, WIDTH=14, SLD=http://127.0.0.1:8080/proprietati/tmpo/ro25858_spatii_pretmp.sld, HEIGHT=14, LAYER=proprietati:ro25858_spatii}
    Get = false
    BaseUrl = http://localhost:8000/geoserver/
    RequestCharset = null

EDIT2
Geoserver is getting the data ok in style visualisation. I don't get it. Here is the picture:

EDIT3
Still no solution found.
As a workaround - I've generated my Legend from  with CSS and PHP


texts: Exporting several files at same time in QGIS?

texts:
I have a lot of .TAB files open in QGIS and I want to save them to .SHP so I can work with them in ArcMap.

Is there a way to save/export all these files at the same time or do I really have to "save as" separately for every single file?


texts:
I can't install the addon in grass 6.4.3 to my linux mint. i've already installed the SVN and than it says:

GRASS 6.4.3 (fabian_idrisi):~ > g.extension r.fuzzy

Fetching  from GRASS-Addons SVN (be patient)...
A    r.fuzzy/local_proto.h
A    r.fuzzy/shape.png
A    r.fuzzy/main.c
A    r.fuzzy/boundary.png
A    r.fuzzy/description.html
A    r.fuzzy/fuzzy.c
A    r.fuzzy/Makefile
A    r.fuzzy/set.png
 U   r.fuzzy
Checked out revision 60053.
Compiling ...
Makefile:13: /usr/lib/grass64/include/Make/Module.make: No such file or directory
make: *** No rule to make target `/usr/lib/grass64/include/Make/Module.make'.  Stop.
ERROR: Compilation failed, sorry. Please check above error messages.

I try to locate that directory but my usr/lib/grass64/ folder only contain scripts, bin, driver,lib licale ect.

What am i doing wrong?


texts: Giving colors to buildings in CityEngine?

texts:
I am new to CityEngine and using trial version 2011.2.I want to know how the colors are given to buildings?

Cga rule file for buildings I have written is :-

*/

version "2011.2"

attr BUILD_HEIGHT=0

attr Mass_Color = "#ffaa33"

attr opacityvalue=0.6

@StartRule

Lot-->

   extrude(BUILD_HEIGHT)

   color(Mass_Color)

   set(material.opacity,opacityvalue)

Is there something I am doing wrong or missing ?


texts: Querying Landsat 8 night images in Google Earth Engine?

texts:
Apparently, Landsat 8 occasionally acquires images at night-time during ascending passes. However, in the Google Earth Engine data catalogue (https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C01_T1_RT), there is no parameter like "orbit" or "pass".

Is there any other way to filter the Landsat 8 image collection for those night images?


texts: How to import shp files into postgresql with PostGIS?

texts:
I'm a new user of postgreSQL/postgis but I'm having a problem.

I'm trying to import some shapefiles (which open perfectly in QGIS or ArcGIS but create an error when i import them). The problem is not because it's in a directory with accents (that was my first problem).

When loading the data, I get this message :

> Importing with configuration: nyc_neighborhoods, public, geom,
> C:\Users\Lay\Desktop\NYC\nyc_neighborhoods, mode=c, dump=1, simple=0,
> geography=0, index=1, shape=1, srid=0 Shapefile type: Polygon PostGIS
> type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
> SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE
> "public"."nyc_neighborhoods" (gid serial, "boroname" varchar(43),
> "name" varchar(64)); ALTER TABLE "public"."nyc_neighborhoods" ADD
> PRIMARY KEY (gid); SELECT AddGeomet" Failed in pgui_exec(): ERREUR:
> la fonction addgeometrycolumn(unknown, unknown, unknown, unknown,
> unknown, integer) n'existe pas LINE 8: SELECT
> AddGeometryColumn('public','nyc_neighborhoods','geom'...
>                ^ HINT:  Aucune fonction ne correspond au nom donné et aux types d'arguments. Vous devez ajouter des conversions explicites
> de type.
> Shapefile import failed.

It's in french though I installed postgis in english to avoid this problem. It says that there is no specific function associated and given to the different types of arguments and that i have to add specific conversions. However, I do not really get what this error means or how I can solve it. I hope some off you know!!

Thanks!


texts: AttributeError:'QgsVectorLayer' object has no attribute 'setSelectedFeatures' PyQGIS 3.0

texts:
What is the new expression of setSelectedFeatures in PyQGIS 3.0 ?
I wrote the following code:

def verCode(layername):
  layer = QgsProject.instance().mapLayersByName(layername)[0]
  selection= layer.getFeatures(QgsFeatureRequest().setFilterExpression('"CODE_MERC" is NULL'))
  layer.setSelectedFeatures([s.id() for s in selection])
  iface.mapCanvas().zoomToSelected()


texts: Global height data as polygons — Natural Earth doesn't have it?

texts:
I love the bathymetry data from Natural Earth. I've been looking for the last few days for the same basic data but for land. I'm trying to find general elevation shapefiles, as polygons. I don't need it to be 100% accurate since it's just for appearance of a stylised map.

Unable to find it, I've been trying to make it in QGIS. I've managed to convert global heightmap data to a shapefile, but it came out as squares matching pixels. That's no good. Trying to convert contours to polygons doesn't work, obviously,

Is there a place to download elevation shapefiles equivalent to the Natural Earth equivalent bathymetry?

Why is it so hard to find lower resolution elevation data that's global?


texts: Export 3D DXF elevation line with multiple Z-values to points each with a discrete Z-value

texts:
We are using a new program that outputs DXF lines with elevation data. I need to compare this data over multiple time-series, but I don't know how to extract it. If I use the identify tool, I can see that all the discrete Z-values are present in the file (closest vertex Z), but I don't know how to extract these values.
I can extract the staring value using "z( start_point( $geometry ))", but I was wondering if there is a way to convert the 3D DXF line into a series of points, each with it's discrete Z-value?


texts:
I'm a mediocre to intermediate ArcGIS user. I have created several point shapefiles, one for each section of a national cemetery, roughly 200-600 points in each section in a grid. Attached to these points in the attribute table are the names of the people buried there, along with some fields such as rank, honors, etc.

I'd like to write a program (should be pretty simple) to query this map and highlight different attributes on command. For example, if I wanted to see where all the members of the 7th Cavalry are buried, I could just enter "7th_Cav" (or whatever string I wanted). The idea is that someone with limited GIS experience (like many of the people I work with) could use this program.


texts: Request to run MapBasic 10.5 code in MapBasic 9.1 version

texts:
I have created MapBasic code using 10.5 version. Now I have to run in a lower version (9.1).

Please anyone help me how to do this...

How to copy paste the program code from 10.5 version to 9.1 version?


texts: Calculating Field based on Domain Description of Another Field

texts:
I am trying to get the description from a field to write to another field.
However, When I calculate the new field it gives me the code and not the description. I tried using VB, but I can't seem to get the code correct.
1 = Buildings
2 = Roads
3 = Other Paved

If [ClassName] = "1" then
x = "Buildings"

Elif [ClassName] = "2" then
x = "Roads"

Else
x = "Other Paved"
End If

Can anyone advise?


texts: I can't print a map with QGIS 2.8.1 and Mac OS X

texts:
I'm using Mac OS X 10.7.5 and QGis 2.8.1.

I want to print a map with Print Composer. But the Buttons "Print" or "Export as PDF" don't work for me. If I use these buttons, the window for choosing a directory or printer appears but only for 1 sec. Afterwards nothing happens. What am I doing wrong?

If I want to save a QGIS Project the window for choosing a directory appears and I can choose the path. The issue is only by using Print Composer.


texts: QGIS GDAL selects XYZ driver rather than GTIFF etc

texts:
I think this is an issue to do with running QGIS on a mac but I might be wrong.
When I run a GDAL tool like clipper or translate GDAL seems to select the -XYZ driver regardless of what the input files are so the tool fails to run properly. If I manually edit the GDAL script to change the -XYZ to GTIFF the tool runs fine.
I have been living with this for a while but it would be nice to fix it.

QGIS 2.18 kyngKhaos MAC OSX 1405.7461 El Capitan i7 32GB ram


texts: I work in an environment where both the program files for QGIS as well as the connection to the Plugin repository are blocked. Is there a way that I can point QGIS to look in an alternative directory for python plugins. I can see that this is possible for C++ plugins but fail to see an option for Python ones.


texts: Ignoring multi-collinearity in spatial stepwise regression modeling?

texts:
We have used multi-linear regression (stepwise) approach to perform spatial modeling with parameters derived from Remote Sensing data. The outcome of the statistically significant components produce respectable RMSE with acceptable R Square and adjusted R Square. However, it is notable that the identified significant parameters violate VIF and Tolerance range in multi-collinearity diagnostics. The produced model is closed to reality with very good RMSE value.

In this backdrop, can we use this model by ignoring VIF and tolerance statistics because, in spatial domain, co-relation between variables is found to be a common phenomenon.


texts: Need to edit and rearrange Text points in QGIS

texts:
I have thousands of points currently saved as a Drawing Interchange file that I brought into a QGIS project. Each point has attributes that has one bar of text assigned to it.  I need to add a word above these points and also flip two of the points for every circumstance.  Since there are thousands it would be a real waste of time to do this for each point.

As shown in the picture there are numbers on top and then the names underneath.  I want the Top number and the name to switch places.  After that I need to add the phrase 'N/f' above both number and the name.  I know how to get rid of the other two rows of numbers on the bottom through excel.


texts: I have two layers. Layer 1 contains points (x,y) and layer 2 contains one polygon. All points in layer 1 are positioned within the polygon of layer 2. The points in layer 1 contain an attribute with information on the topography/elevation at the specific point. Can I color the polygon in layer 2 based on attributes from the points in layer 1 in order to create an elevation map?


texts: Map scales in QuickMapServices vs Google Earth

texts:
I'm seeing a very problematic difference between the size of objects in Google Earth vs the GoogleMAps layer of QuickMapServices (QMS).  See the image, the footbridge over the Tyne comes out to 103 m wide in Google Earth but in the same image, QGIS gives it as 183 meters wide.  I've had similar scaling isues when creating buffers based on polylines drawn from QMS base maps in QGIS.  What I do there is create the vector in WGS84 UTM, digitise on the basemap, then buffer.  But this gives sizes that are off by a similar factor to the scaling error in the image above.

What's going on?


texts: Secure credentials for scheduled python script targeting ArcSDE 10.1 on AWS

texts:
I have a python script that will be used as a scheduled task.  Our dba team is wanting the credentials to be as secure as possible.  I would say that using the os security system as far as locking down a folder is my suggestion.  This doesn't seem to be enough.  Another idea is to encrypt a plain text file then un-encrypt it at runtime...

as described here
https://stackoverflow.com/questions/12042724/securely-storing-passwords-for-use-in-python-script

I don't understand where the secure key would reside.

I had a look at this on gis.se but it doesn't seem to be secure
Good practices for storing connection info while deploying geoprocessing tool on Server

Another idea I've seen is to build the script as an exe but it seems like this can be reverted to the actual script.  Same with importing a pyc file that has the credentials.

I have access to visual studio and can write c# code well enough if this would help.  Maybe the whole thing in c# but my ArcObjects skills may not be up to snuff for the cost/benefit for how much time it may take me.

Any ideas are welcome.  Maybe this is more of a wiki...not sure.  Thanks.


texts:
I have a 3D building model (Polygon ZM) that I would like to turn to DEM, following the accepted answer to Elevation data from 3D shapefile of buildings to raster DEM

According to the description, Polygon ZM should be first converted to TIN before I could convert it to raster.

For some reason, converting Polygon ZM to TIN leads to error so I did an additional step "Feature vertices to points" (1st image) before "Create TIN". This way I can produce a TIN (2nd image) but it is not quite similar to the original Polygon ZM. Any ideas how could I make the TIN more accurate?


texts: How can I convert electric utilities into water utilities?

texts: I have GIS information for transmission lines, substations, and power generation facilities. I was able to import it into ArcGIS easily and create a geometric network. However, I'd really like to have access to the Water Utilities Network toolbars which have powerful tools and reporting capabilities that are not available in the electricity world. Since electricity and water are strongly related (voltage = pressure, current = flow, etc) I'd like to represent the electricity network as a water network and use the toolbar. Is this possible? If not, is there another way to access the water utility network tools for electricity?


texts: Splitting lines with points while maintaining other dissolved lines?

texts:
I am on ArcGIS Desktop 10.2. I have a line feature class of a stream network. I also have a point feature class along the main stream (line) where a catchment enters that stream. I have dissolved my whole streams layer into one line feature and want to split this feature at the points.

However, when I use the Split Line At Point tool, the lines that don't have a point splitting them are still being split at the intersection of two streams.

Why did this line not stay as one feature with the other lines on that side of the splitting node and how can I prevent this from happening?


texts: Adding field with prices based on ground use using ArcGIS Spatial Analyst?

texts:
I need to calculate the least cost path for a water pipe. The layers I have now are land use, slope, soil type and protected natural parks. Now my teacher has given me the prices of building a water pipe. For example: the soil type layer consists of Sand, Clay, Lime, Loam and Other. Sand and Clay are €10 for each meter and Lime and Loam are €30/m. The Land Use layer has 4 categories with different prices for each category. And the slope is based on % of the total price. Protected natural parks is forbidden.

Now my first question is if I can use Weighted Overlay for this. I have completed Esri's Spatial Analyst tutorial. But I can't see how I can use these prices for this.

Instead I thought of another method, by creating a cost raster. This cost raster includes all the used layers, but these layers all must have prices added. But I tried this for the soil type layer and I'm stuck now. I added a new field to the layer with the name "Costs". I used the Field Calculator to replace the soil types in the field "Soil" to the price that belongs to the soil type. For example Replace( [LETTER],"BLb/Ldh/Ldd/Ld/BLd/AHl/Lnd/BLn/Lh/ABl/Ln/BLh","30"). BLb/Ldh/Ldd/Ld/BLd/AHl/Lnd/BLn/Lh/ABl/Ln/BLh stands for Loam, I reclassified this. So I tried to place 4 of these Replace functions behind each other. But I get the same error everytime: 000539: invalid syntax (, line 1). I'm probably doing something really wrong, but I couldn't find anything similar on the internet.

My second question is therefore how I could get this tool running.

I'm not really skilled in ArcGIS yet.


texts: Using PlanetScope basic scenes with the ArcGIS mensuration tools

texts:
I would like to measure vertical heights from shadows in PlanetScope basic scenes. To do this, I am using the mensuration tools in the analysis window in ArcGIS desktop.

When I load the PlanetScope scene into arcmap, I find that the "Base to top height" tool is active, however the "Top to shadow height" tool is greyed out. As I understand it, this means ArcMap is recognising the RPCs in the *_RPC.TXT file, but not the solar azimuth/altiude data in the json file. I was wondering if anybody knows how to make ArcMp recognise the solar illumination information to activate the "Top to shadow height" tool?


texts: % Cover of polygons within radius of points

texts:
I Have a polygon layer representing multiple sites in a city.

I want to calculate the combined % cover of all sites within buffered regions around points.

What would be the best way to go about this?


texts: Merging duplicated fields within merged layer using ArcMap?

texts:
In ArcMap 10.6, I'm merging a series of layers with shared attribute fields. After I merge, every field is duplicated instead of combined, so it looks like this (real thing too wide for screenshot):

    FieldA   FieldB   FieldA     FieldB
      y        a      <NULL>     <NULL>
      x        b      <NULL>     <NULL>
    <NULL>   <NULL>      x          b
    <NULL>   <NULL>      x          b

What is the code needed in Field Calculator to instruct "FieldA = if Null, = value of other Field A, if not Null, leave as is"

Desired result:

    FieldA   FieldB
      y        a
      x        b
      x        b
      x        b

The answer here Field calculator if and elseif statement with <Null> values in ArcGis 10.1 was close but not quite. I think I might be doing something fundamentally wrong in my merge for the attribute table to form this way. The layers being merged have been joined to the same .csv prior to the merge.


texts:
I am working with ArcObjects, in particular the ICursor Interface. I am creating a cursor and looping through a query's result set. My problem/concern is how to close or delete or release the cursor once I'm done looping through the query's result set. The query is being passed into a Sql workspace (via ISqlWorkspace interface). Code is as follows

ISqlWorkspace pSQL_WS = myWorkspace as ISqlWorkspace;
ICursor pCursor = pSQL_WS.OpenQueryCursor(strQuery);
string cursorResults = "";
IRow pRow;

while ((pRow = pCursor.NextRow()) != null)
{
  int fc = pRow.Fields.FieldCount;
  for (int x = 0; x < fc; x++)
  {
    cursorResults += pRow.get_Value(x).ToString() + "     ";
  }
    cursorResults += Environment.NewLine;
}
_textElement.Text = Convert.ToString(cursorResults);

I'm actually taking the results of the query and placing them in a text element. I'm thinking after the last line is where I'd want to close/delete/release my cursor, but I'm just not sure how to go about doing this.


texts: Atmospheric correction using ENVI Flaash

texts: I want to perform atmospheric correction of both Landsat 7 and Landsat 8 data. I am using ENVI 4.5. What scale factor should I choose for Landsat 7 and Landsat 8? Plese suggest.


texts: How do I keep the unique segmented treeID when exporting the .las file

texts:
I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.
I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column treeID to ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for rename applied to an object of class c('LAS', 'Spatial').
library(lidR)
library(dplyr)

# Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)

#  trying to rename the columns like you can in a dataframe
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
# using the pipe function
las1 %>% rename(treeID=ReturnNumber)

colnames(las1)

# write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)


texts: NDVI derived from Landsat band 3 and band 4 using QGIS raster calculator shows the different range when opening in the ArcGIS

texts:
I have calculated Normalized difference vegetation indices from landsat 5 band 3 and band 4 that have 0-0.38 minimum and maximum ranges respectively. But whenever I open the same NDVI.tiff file in ArcGIS 10.1, it shows me the 0-0.68 valid ranges.
Is there any different interpolation techniques of showing the same file in different software?


texts: raster2pgsql fail with JPEG encoded image

texts:
The problem

I have one JPEG encoded raster that works in GDAL and QGIS. The original file 05-D Braga.jpg is available online. The CRS is EPSG:20790.

To upload it to Postgis, I use:

raster2pgsql -s 20790 -d -I -C -F -t 512x512 -l 2,4,8,16,32,64,128,256,512 "05-D Braga.jpg" raster.geologica  | psql service=pg_geotuga

The raster table and overview tables are created. But I'm not able to see the resulting raster in QGIS. The original image works well (from the file system), but from Postgis, it does not work.

I have several other rasters on the same database. This is just the one that does not work.

Any clues about the problem?

gdalinfo details

gdalinfo of the resulting Postgis raster:

jgr@zoe:~/bonn/ownCloud/ShareGeomaster/Dados/05-D$ gdalinfo PG:"service=pg_geotuga dbname=geotuga schema=raster table=geologica mode=2"
Driver: PostGISRaster/PostGIS Raster driver
Files: none associated
Size is 10619, 7761
Coordinate System is:
BOUNDCRS[
    SOURCECRS[
        PROJCRS["Lisbon (Lisbon) / Portuguese National Grid",
        (...)
Data axis to CRS axis mapping: 1,2
Origin = (161494.310841620987048,523702.407182264025323)
Pixel Size = (4.248602672300000,-4.236062656300000)
Corner Coordinates:
Upper Left  (  161494.311,  523702.407) (  0d32'15.25"E, 41d40'48.54"N)
Lower Left  (  161494.311,  490826.325) (  0d32'22.83"E, 41d23' 2.97"N)
Upper Right (  206610.223,  523702.407) (  1d 4'45.79"E, 41d40'51.79"N)
Lower Right (  206610.223,  490826.325) (  1d 4'44.49"E, 41d23' 6.19"N)
Center      (  184052.267,  507264.366) (  0d48'32.08"E, 41d31'58.53"N)
Band 1 Block=2048x2048 Type=Byte, ColorInterp=Red
  Overviews: 5309x3881, 2655x1940, 1327x970, 664x485, 332x243, 166x121, 83x61, 41x30, 21x15
Band 2 Block=2048x2048 Type=Byte, ColorInterp=Green
  Overviews: 5309x3881, 2655x1940, 1327x970, 664x485, 332x243, 166x121, 83x61, 41x30, 21x15
Band 3 Block=2048x2048 Type=Byte, ColorInterp=Blue
  Overviews: 5309x3881, 2655x1940, 1327x970, 664x485, 332x243, 166x121, 83x61, 41x30, 21x15

gdalinfo of the original raster:

jgr@zoe:~/bonn/ownCloud/ShareGeomaster/Dados/05-D$ gdalinfo '05-D Braga.jpg'
Driver: JPEG/JPEG JFIF
Files: 05-D Braga.jpg
       05-D Braga.jpg.aux.xml
       05-D Braga.jgw
Size is 10614, 7739
Coordinate System is:
PROJCRS["Lisboa_Hayford_Gauss_IGeoE",
  (...)
Image Structure Metadata:
  COMPRESSION=JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left  (  161514.667,  523608.581) (  8d35'38.71"W, 41d40'45.50"N)
Lower Left  (  161494.311,  490825.692) (  8d35'32.04"W, 41d23' 2.95"N)
Upper Right (  206609.336,  523702.407) (  8d 3' 9.11"W, 41d40'51.79"N)
Lower Right (  206588.980,  490919.518) (  8d 3'11.28"W, 41d23' 9.21"N)
Center      (  184051.824,  507264.050) (  8d19'22.80"W, 41d31'58.52"N)
Band 1 Block=10614x1 Type=Byte, ColorInterp=Red
  Overviews: 5307x3870, 2654x1935, 1327x968
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 2 Block=10614x1 Type=Byte, ColorInterp=Green
  Overviews: 5307x3870, 2654x1935, 1327x968
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 3 Block=10614x1 Type=Byte, ColorInterp=Blue
  Overviews: 5307x3870, 2654x1935, 1327x968
  Image Structure Metadata:
    COMPRESSION=JPEG

More info

gdal is able to read the image, for example, and save it as tiff. The resulting image (from the file system) displays well in QGIS. If I insert the converted GTiff image, it does not work.

gdal_translate -of GTiff "05-D Braga.jpg" 05-D.tiff

QGIS image preview

In the screen shot below, both the image from the file system and from Postgis as shown. Using map swipe, we can see that only one displays properly.


texts: Convert colum type in PostGiS via DB Manager/ SQL in QGIS

texts:
I have a csv file that I want to bring into a PostGIS database through DB Manager in QGIS. I have a column/ field called "Location" that contains geometry (e.g. (40.789423 -75.628493 232.95452117919922 5). The first two are lon/lat, the second is altitude and third is error for the GPS unit it was collected with. I ONLY need the first two pieces of data (i.e. lon/lat).

When I pull this data into PostGIS database with DB Manager, it will not recognize this column as geometry, but identifies it as TEXT (varchar). I would like to change this, but am having trouble. I prefer to use a GUI, but it will not convert. I am trying to figure out the correct SQL code to do this. Here's my most recent attempt:

ALTER TABLE "schema"."table" ALTER "Location" TYPE geometry USING ("Location"::geometry)

However, this returns the following error message:

parse error - invalid geometry
HINT:  "40.789423 " <-- parse error at position 10 within geometry

I believe that this is because there is an extra space after the "40.78923". Does this seem correct? If so, how do I fix this?


texts:
I'm getting started with QGIS and I want to use survey data to generate isolines. Contour plugin works well except when surveyed area has linear details (say, a road) that are elevated relative to the surrounding terrain.

One way to deal with this is to insert points at regular interval (say 20 cm) between points with same code (top of the slope, bottom of the slope).

What is the proper way of dealing with this in QGIS? Is there any plug-in that also uses the concept of "line" along with that of a "point" to generate DTM/contours?

Edit: by "line" here I actually mean a line segment with the two end-points having 3D coordinates (acad style).

Alternatively, what is the easiest way of inserting intermediate points in the fashion described above?


texts: QGIS - delete polys based on vector line layer - possible?

texts:
I have a layer of polygons and a layer of vector lines.  I want to delete any poly that is touched/crossed/intersects a vector line.  Is this possible?

I have tried the Geoprocessing Tools.  Looks like I want 'Difference' but the best I can do is delete segments of lines that touch polys.  I want the opposite.


texts:
I'm working on QGIS3 and I'm looking for a plugin to print multicomposers at once. I know that in QGIS2 there is a plugin (multiprint) that does this, but for QGIS3, I can not find anything similar.

Do you have any suggestions?


texts: Improve DTM under forested areas without smoothing?

texts:
I'm using a DTM retrieved from LiDAR data and I noticed that forested areas are grainy or not defined. The DTM data was retrieved from geostore.com. Here is one example:

Is there any way to directly improve the DTM file; or do we need the raw LiDAR data (las files) in order to rebuild the DTM and get better results?

Here is the same location viewed from a satellite image.

And here is an attempt of DTM made from a DSM in SAGA:

Note that I don't want to smooth the DTM as I do archaeological surveys and any smoothing of the surface would hide the barely visible features.


texts:
I imported OpenStreetMap data of Karlsruhe to PostGis using osm2pgsql. This creates 4 table, one names planet_osm_roads. Sadly this table does only contains major streets. Smaller streets can be found within planet_osm_line, along with a lot of other stuff such as railways, bicycle tracks...

Is this an error of OSM or on purpose? Do you know any data set containing all streets which can be accessed by car?


texts: Is it possible to have label in QGis 2.8 two different colours? For example Field1 in red colour and Field2 in blue (Field1 || ‘  ’ || Field2).


texts: I have a problem regarding the size conversion from the legend elements tab an the actual legend.


texts: How to convert the area to feets in GeoDjango?

texts:
my geom has     //

When I am trying to get the area of the polygon

 geom.area   //7.27640644096346e-08

How to get these value in feets. I don't know what is the units of these value

I am trying to get these value in meters by geom.area.sq_m  but it throws the error "'float' object has no attribute 'sq_m'"

Can any help me to get it done


texts:
I just converted to QGIS 3 (3.4.4). My Spatial Bookmarks panel is empty.

Is there something I need to do to get them?


texts: I have been trying to figure out how to make a flood delineation map, and the tool runs, but I'm getting this error "001003: Datum conflict between input and output." I thought this would be as simple as the spatial reference system datum, but I have them all in the same reference type. I thought the datum error might also be from the water datum measurement compared to the raster elevation measurement, but even changing the point water level height did not fix my problem. I'm not sure what the problem would be at this point.


texts:
I'm trying to make a map of Paris and downloaded data from OSM that I'm currently organizing with QGIS.

The issue is I'd like to display all street names as labels yet many streets are rather small so labels are overlaying.

I need the labels to be "parallel" to the street (hence the corresponding label feature to be turned on) yet be able to move them around easily keeping them parallel which I'm currently unable to do.

When I move the label, it becomes horizontal instead of staying parallel to the street (see pictures bellow).

I know I can still turn them manually to get them where I want but considering it concernes thousands of streets I'd rather find a more suited tool to do so as efficiently as possible.

------- edit ---------

I tried using ARCGIS PRO and its labeling motor works great and solved all my issues !

Hugo


texts: Haversine formula to calculate distance between real coordinates?

texts:
I need to calculate distance between two stations in a map in order to calculate empirical variogram in ordinary kriging to interpolate temperature data.

Calculating distance in kriging using Euclidean distance formula between two points on XY axes, and I found that not sufficient because I specified Lag_units and Lag_distance in meters when I programmed kriging.

Can I use the haversine formula to calculate distance between real coordinates instead of Euclidean distance?


texts: psql changing comma to decimal for importing CSV file

texts:
I try to import a CSV file into a PostgreSQL database that runs on a remote server.
I use psql via SSH.

AIS_DB=# CREATE TABLE bet_srk_2008 (
AIS_DB(# Unique_VesselTraject numeric,
AIS_DB(# AISTrajectPositionTimestampLocal timestamp,
AIS_DB(# RandomVesselAISKey varchar,
AIS_DB(# AISTrajectPositionSpeedOverGround varchar,
AIS_DB(# AISTrajectPositionCourseOverGround varchar,
AIS_DB(# VesselAISLength varchar,
AIS_DB(# VesselAISBeam varchar,
AIS_DB(# VesselAISMaximumDraught varchar,
AIS_DB(# VesselTypeAISDescription varchar,
AIS_DB(# BOZ varchar,
AIS_DB(# AISTrajectPositionLatitude numeric,
AIS_DB(# AISTrajectPositionLongitude numeric,
AIS_DB(# TrajectAISDestination varchar
AIS_DB(# );

CREATE TABLE

AIS_DB=# \COPY bet_srk_2008 FROM '/home/thecaptain/Export2008.csv' DELIMITERS ';'CSV HEADER;

ERROR:  invalid input syntax for type numeric: "51,2628135681152"
CONTEXT:  COPY bet_srk_2008, line 2, column aistrajectpositionlatitude: "51,2628135681152"

I think the problem is that the data uses a comma instead of point as a decimal. Is there a way to circumvent this in the import process?
The datasets have 100 million+ lines and a find and replace is making nano run out of memory.
If I use VARCHAR instead of NUMERIC it won't let me ST_MAKEPOINT it to the geom column.

This is the whole text:

CREATE TABLE bet_srk_2008 (
Unique_VesselTraject numeric,
AISTrajectPositionTimestampLocal timestamp,
RandomVesselAISKey varchar,
AISTrajectPositionSpeedOverGround varchar,
AISTrajectPositionCourseOverGround varchar,
VesselAISLength varchar,
VesselAISBeam varchar,
VesselAISMaximumDraught varchar,
VesselTypeAISDescription varchar,
BOZ varchar,
AISTrajectPositionLatitude numeric,
AISTrajectPositionLongitude numeric,
TrajectAISDestination varchar
);

\COPY bet_srk_2008 FROM '/home/thecaptain/Export2008.csv' DELIMITERS
';'CSV HEADER;

ALTER TABLE bet_srk_2008 ADD COLUMN geom geometry (POINT, 4326 );

UPDATE bet_srk_2008 SET geom
ST_SetSRID(ST_MakePoint(AISTrajectPositionLongitude,
AISTrajectPositionLatitude) ,4326);

CREATE INDEX bet_srk_2008_index ON bet_srk_2008 USING GIST ( geom );


texts:
I am trying to execute the following:

    INSERT INTO lithic (cp_east, cp_north, type, material, art_count, comment, field_no, gps_unit, initials, rec_date, cortex, geom)

SELECT (cp_east, cp_north, type, material, art_count, comment, field_no, gps_unit, initials, rec_date, cortex, geom)

FROM lithic_9375_1230

WHERE lithic_9375_1230.rec_date > '12/18/2013'

My goal is to insert the rows in lithic_9375_1230 with rec_date later than 12/18/2013 into the table lithic.  When I execute the above code I get the following:

ERROR: INSERT has more target columns than expressions
SQL state: 42601
Hint: The insertion source is a row expression containing the same number of columns expected by the INSERT. Did you accidentally use extra parentheses?
Character: 30

I'm running PostgreSQL 9.1 which was installed as a component of the OpenGeo suite.  The two tables are different versions of the same shapefile which have been imported into Postgres via the pgShapeLoader tool.  They use the same SRID.


texts: gisgraphy geocoder - importing custom data

texts:
I have been researching offline geocoders - and am impressed with what I've seen in Gisgraphy.  It is especially attractive to my environment, since I am on Windows Server 2008 and Apache Tomcat.  Nominatim is also very robust - but will be too much of a challenge to stand up in this environment given my current schedule and resources.

I have a few 'custom' datasets that I would like to add to gisgraphy: polyline streets and address points.  I haven't found any usable instructions to accomplish this.  I poked around in the PostGIS db, SOLR stuff, and even source code to see if the access point(s) were easily identifiable - but I'm afraid not.

Has anyone loaded custom datasets into gisgraphy?  Any pointers on how I could do this?


texts: Convert Mapsforge (v3) rendertheme to Mapbox style?

texts: Is it possible to convert a Mapsforge (v3, but also works in v5; both versions are included in c:geo for example) rendertheme (XML file plus patterns and symbols) to something usable as style in Mapbox Studio (which is then usable as raster map in Leaflet, for example)?


texts: Why does ESRI make me store my DBF doubles as strings?

texts:
As far as I can tell I have to store all numeric values in a shapefile's associated DBF file as strings (yes, the N type is essentially a string).
Can anyone confirm that ESRI does not support the use of Double (O) nor Long (I) data types in the .DBF file?

I'm using this DBF reference

Based on the response thus far I apparently did not provide enough information.  My question is not one of precision but rather one of optimization.  When manually setting a dbf field to type O (for double) in the dbf file, I receive this message when trying to load the standalone table into ArcMap.

Storing the number 1.23456789123434 as type N (defined in linked document as: "Number stored as a string, right justified, and padded with blanks to the width of the field.") costs me 15 bytes while storing the same number as type O (double) would cost me only 8 bytes.  Please correct me if I am wrong on this.


texts: Converting NetCDF dataset array to GeoTiff using rasterio Python

texts:
I have read a NetCDF file using the netCDF4 library and then read one of its datasets ("Evapotranspiration") into a variable (variable contains array) using the following code. Subsequently now I am trying to convert this array into a GeoTIFF file using rasterio. However, the resulting GeoTIFF is appearing to be rotated by 90 Degrees when I am opening it in QGIS. Following is my code:
from netCDF4 import Dataset
import rasterio
from rasterio.transform import from_origin

nc = Dataset(r'D:\Weather data\et_01012018.nc','r')

lat = nc.variables['latitude'][:]
lon = nc.variables['longitude'][:]
et = nc.variables['Evapotranspiration'][:]

transform = from_origin(68.175 , 37.025 , 0.05, 0.05)

profile = {'driver': 'GTiff', 'height': et.shape[1], 'width': et.shape[0], 'count': 1, 'dtype': str(et.dtype), 'transform': transform}
with rasterio.open(r'D:\Weather data\test.tif', 'w', crs='EPSG:4326', **profile) as dst:
     dst.write(et,1)

Further I also tried GDAL to implement the same but no success as of now. I am getting same results i.e. the raster file is rotated by 90 degrees in clockwise direction. Following is the code implemented by using GDAL:
import gdal, osr
from netCDF4 import Dataset

nc = Dataset(r'D:\Weather data\et_01012018.nc','r')
lat = nc.variables['latitude'][:]
lon = nc.variables['longitude'][:]
et = nc.variables['Evapotranspiration'][:]

# reverse array so the tif looks like the array
et_T = et[::-1]
cols = et_T.shape[1]
rows = et_T.shape[0]

# Origin should be in Longitude-Latitude form
originX = 79
originY = 21

driver = gdal.GetDriverByName('GTiff')
outRaster = driver.Create(r'D:\Weather data\test.tif', cols, rows, 1, gdal.GDT_Float64)
outRaster.SetGeoTransform((originX, 0.05, 0, originY, 0, 0.05))
outband = outRaster.GetRasterBand(1)
outband.WriteArray(et_T)
outRasterSRS = osr.SpatialReference()
outRasterSRS.ImportFromEPSG(4326)
outRaster.SetProjection(outRasterSRS.ExportToWkt())
outband.FlushCache()
outRaster = None

Can you help me to resolve the issue?


texts: Feature Access ArcGIS 10.1 Registered Database Publishing Error

texts:
I created a feature class from an XY table in ArcCatalog, and I am trying to publish a feature access enabled map to my server.

When I try, I keep getting a 00090 error which is "feature service requires a registered database". I registered my database using server manager by creating a .sde file with a python script, and the table and shapefile are in my enterprise geodatabase (created and enabled with the tool in ArcGIS). The database validates on the server manager page.

I have an ArcGIS server (10.1 SP1) running on a Microsoft 2012 Datacenter Edition Server. I am using MSSQL 2012 enterprise editionand trying to publish with ArcMap 10.1.

I am very new to ArcGIS, so I may be forgetting/overlooking something silly, but any help would be greatly appreciated.

I tried ArcGIS Server Error: "Feature service requires a registered database".


texts: Efficient intersect query for virtual layers in QGIS

texts:
I have 3 tables/shapes as follows:

ADRR (adress points)

ADRR_ID | ST_ID (street surface id) | point geometry

STREET

ST_ID | ST_NAME (street name) | polygon geometry

Obstacles

ID_OBS | polygon geometry

Each address point is associated with a portion of street stored in the STREET table.

For each address, I want to check whether there is an obstacle in that STREET portion.

I want a column with a 'Y' or 'N' value to check whether the obstacle is or not present.

In order to do this, I used the VIRTUAL LAYER function in QGIS.

select
    adrr.*
    ,(case when st_intersects(adrr.geometry, obstacles.geometry) then 'Y' else 'N' END)  V
from
    obstacles,
    adrr
    join STREET
        on street.st_id = adrr.st_id

I don't have any error message but QGIS crashes each time I want to visualise the attributes of the resulting layer.

I created spatial indexes for all my tables but it didn't seem to help.
Does anyone have another suggestion?


texts:
I downloaded this .tif image of the world (small version) from Natureal Earth and tried to convert it to tiles using Gdal2tiles in OSGeo4W.

In the terminal, I used the following commmand:

gdal2tiles -z 0-4 -w none -s EPSG:4326 NE2_50M_SR.tif

and the process went smoothly, except that something appears to have gone wrong the projection. It should be noted that I'm new to both gdal and displaying tiled maps online.

When I try to use the tiles in leaflet.js, this is what I end up with. Does anyone have any ideas of what the fault might be?


texts: Chainage plugin (Qchainage) not starting at the beginning of line

texts:
Chainage points not beginning at the start of each line - using QGIS 2.18.2 and Qchain plugin I select the lines layer I'm working with, adjust chainage to every 10m and select "show label".
Can anyone advise what steps I might be missing or I need to take to correct.


texts: Interpolating Daily Values from Monthly Grids using QGIS?

texts:
I am currently performing a bioclimatic analysis using monthly averaged climate grids. One particular calculation, Growing Degree Days, relies on daily maximum/minimum temperature and a threshold temperature that is surpassed (0, 5, 10, etc. Celsius). For instance, Winkler's GDD calculation is as follows

  Σ [April 1, October 31] : [ ((Max Temp + Min Temp)/2) - 10 ]

My approach to date has been to perform this calculation using the monthly values and then multiply the sum by the number of days in the month for each month. This leads to a rough, step-funtion-like estimate and is not ideal.

In a paper by Coops et al. (2001, International Journal of Geographical Information Science, 15:4, 345-361, DOI: 10.1080/13658810010011401), the authors describe using Singular Value Decomposition to solve the following equation able to provide daily value estimations from monthly climate values:

Where the result is 12 equations per variable (Max and Min Monthly Temperature) with 5 unknowns each (p and q) and X pertains to the Julian Day. The paper goes on to claim that they were able to solve the unknowns and apply this equation to their climate rasters, performing calculations similar to the degree-day calculation listed above. The end result would resemble this curve:

I would like to know how I could possibly perform this type of analysis spatially, solving for p and q for individual climate variables for sets of  raster images representing monthly average values (Max, Min, Mean Temp, etc.) and translate these values either to individual grids representing daily values or outputting to a grid of summed growing degree days above a base temperature.

If possible, I am curious to know if there are any Open Source tools which may already do this (Python, R, PyQGIS etc.) or a way of setting this up through the QGIS Model Builder for performing these calculations on multiple sets of climate data.

I realize this might be better suited to the Math or Earth Science SE's, but given that the solution needs to be performed using raster images, people here likely have much more experience with this type of problem.

Update:

Followed up with the authors and found out that the original code to perform this type of analysis is long gone. They likely approached this using NetCDF files and IDL/Matlab. PyClimate (Link) seems to have capabilities for using SVD to solve curves for coupled data sets, but the documentation is not very clear, and the tools seems to be abandoned (last update in 2004).


texts: Automatically uncheck Boolean field depending on current year

texts:
I'm preparing QGIS for field work. We want to check on street lamp posts. I have three columns:

"Checked" (type Boolean)
"last checked" (type string, contains only the year of the last check)
"next check" (type string, contains only the year of the next check)

My goal is, when a field worker ticks the checkbox (column 1) it automatically fills out the other two columns ("last checked" with the default expression: Case When "checked" is TRUE Then year(now()) END and "next check" with: ...year(now())+6 ... as they need to be revisited 6 years later.
This works ok with one restrain: As soon the year arrives, where a new visit of the lamp post is needed, the checkbox should be automatically unchecked - map/layout wise I solved that with an virtual column that checks if the checkbox is ticked AND if the year is same or smaller than the current year. But I need this also in the data, not only in the map layout. Is there a possibility to uncheck all lamp posts as soon 2021 arrives? Like a yearly cron-job, more or less.


texts: Extracting SpatialPolygonsDataFrame attributes into a dataframe in R. Assigning new vars based on other polygon in R

texts:
Here you can see a group of small and large polygons. Small polygons are cropped as I am only interested in their properties, such as size inside the large polygons. I have two furhter objectives where I need help:

1 - Assign new attribute field_id to individual polygons in Pol_small. The new attribute field will have either 1 or 2 and this will represent within which Pol_large is the individual Pol_small located. In other words, all the polygons on the left (Pol1, Pol2, Pol3, Pol4) will have 1 in the new attribute column, and four polygons on the right (Pol5, Pol6, Pol7, Pol8) will have 2.

2 - Extract information about Pol_small_crop into a dataframe. Each row would represent each individual polygon within Pol_small_crop so a total of 8 rows. I am interested in the area [in sq km] of the cropped polygons (shown in red), and migrating all the other attributes, such as created field_id and others. In this example, te only attributes remaining will be ID.

The same question is posted on SO, I just realised GIS StackExchange is a more appropriate place for it.

library(sp)
library(raster)

create_poly <- function(coordin,id_number){
  coordinates = matrix(c(coordin[1], coordin[3],
                    coordin[1], coordin[4],
                    coordin[2], coordin[4],
                    coordin[2], coordin[3],
                    coordin[1], coordin[3]),
                  ncol = 2, byrow = TRUE)

  P_1 = Polygon(coordinates)
  Ps_1 = SpatialPolygons(list(Polygons(list(P_1), ID = id_number)), proj4string=CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))
  ID_1 <- sapply(slot(Ps_1, "polygons"), function(x) slot(x, "ID"))
  df <- data.frame(rep(0, length(ID_1)), row.names=ID_1)
  Ps1_df <- SpatialPolygonsDataFrame(Ps_1, df)
  Ps1_df
}

# Create shapefile with polygon boundaries of interest:
Pol_large1 <- create_poly(c(80,100,20,40),1)
Pol_large2 <- create_poly(c(120,140,30,50),1)

# Join the polygons into one layer:
Pol_large <- do.call(rbind, list(Pol_large1, Pol_large2))

# Create smaller polygons:
Pol2 <- create_poly(c(79,83,19,30),2)
Pol3 <- create_poly(c(90,92,25,30),3)
Pol4 <- create_poly(c(90,95,33,37),4)
Pol5 <- create_poly(c(98,110,21,24),5)

Pol6 <- create_poly(c(119,123,29,35),6)
Pol7 <- create_poly(c(130,131,33,40),7)
Pol8 <- create_poly(c(130,137,45,47),8)
Pol9 <- create_poly(c(116,125,45,49),9)

# Join the polygons into one layer:
Pol_small <- do.call(rbind,list(Pol2, Pol3, Pol4, Pol5,
                                Pol6, Pol7, Pol8, Pol9))

plot(Pol_large, axes = TRUE)
plot(Pol_small, add=TRUE)

# Crop out polygons
Pol_small_crop <- crop(Pol_large,Pol_small)
plot(Pol_small_crop, border = "red", add=TRUE)


texts: I'm working on a pet project. The blue circles in the map below are highway exits. They exists in pairs of two (one for each side). I'd like to replace them with one point in the middle, indicating that in roughly that area one can access the highway. How would I go about achieving this in QGIS?


texts: Spatial reference conflict: WGS84 or clrk66

texts:
For a raster dataset, trying my.raster@crs or proj4string(my.raster) in R gives the PROJ.4 string "+proj=longlat +ellps=clrk66 +no_defs". I downloaded the raster from SEDAC here - the World link, unprojected (geographic). However, on the metadata link - Spatial Reference it is declared that the ellipsoid and datum are WGS84. However, the PROJ.4 string indicates the ellipsoid clrk66 and no information about the datum. Moreover, in the help file of spTransform-methods {rgdal}, Roger Bivand mentions that:

  In general +datum= is to be prefered to +ellps=, because the datum always fixes the ellipsoid, but the ellipsoid never fixes the datum.

So, given this situation what datum can I assume? Can I assume a WGS84 both for datum and ellipsoid as in the online metadata? I also asked for feedback on the SEDAC's page here, but maybe some of you can help me understand this issue. I also saw a combination of +ellps=clrk66 +datum=NAD27 (epsg:4267) presented here or here, so maybe should I assume datum=NAD27?


texts:
I may be trying to attack this problem incorrectly, so I'm sure I'll be corrected.

I currently have quite a few shapefiles containing all of the major highways, streets, railroads, counties, etc. of Texas. I need to combine all of these files so that they can be used as a base map and then pre-render the tiles that will be served out to the client.

I haven't found a way to do this and was wondering if there is a way that this can be done or a different way to go about it.

The reason that we are using the shapefiles as a base map is because we have to have historical maps. In other words, if a new road is laid and subsequently added to the maps, we will have to keep our old maps and create new tiles for the changes so that if the user has to see why a specific road wasn't taken in the past they can see that at that time the road didn't exist.

UPDATE: A bit more context.

The shapefiles will be loaded into SQL Server 2012 for performing queries, and thus it will be running on a Windows box. I understand that I can use the SQL Server plugin for GeoServer to create a store from the database and then layers from the tables, but the problem with that is there will be several layers used to make up a coherent map, i.e., streets, major highways, counties, etc.

In that scenario the client will have to connect to at least 5 layers just to get the map on the page. I don't know enough about GeoServer to know if it will process all of those layers and then send out tiles containing the content for all specified layers or if it is going to send tiles for each layer laying them on top of each other.

What I want to do is simply take all of the shapefiles and essentially merge them, applying styles, and then generate the tiles from the resulting map so there would only be one set of tiles being served.

Additional Notes:
- Application is being developed in ASP.NET MVC using C#.


texts: Map panning using mouse wheel in OpenLayers 3+

texts: How to achieve functionality that user could scroll through map by pressing mouse wheel and dragging map like he can do it by pressing left mouse button?


texts: Reclassify a raster in order to polygonize python

texts:
I have a GTiff raster with values from 0 to 255 and I want to reclassify 2 values ( 1 and 2) to 1, and the rest set them to NaN, in order to polygonize later and obtain polygons only for the desired value.

Is there a way of doing this?

driver = gdal.GetDriverByName( 'GTiff')
file = gdal.Open( 'area.tif')
band = file.GetRasterBand(1)
lista = band.ReadAsArray()
lista[np.where(lista == 2)] = 1
lista[np.where(lista != 1)] = np.NaN

This fails due to ValueError: cannot convert float NaN to integer


texts: String comparison expression failing in Mapserver when including fieldname

texts:
Within classes I'm able to match strings using CLASSITEM, but not when including the field name in the expression, for example (inside a layer declaration):

CLASSITEM "myfieldname"
CLASS
    EXPRESSION "sometext"
END

Works fine, but

CLASS
    EXPRESSION ([myfieldname] = "sometext")
END

Doesn't return any data

The second method is fine when working with integers, e.g.

CLASS
    EXPRESSION ([myintegerfieldname] = 10)
END

I've tried enclosing the strings with single quotes, double quotes, using a regex instead. The same behaviour occurs when the source data is a shapefile or a postgis layer.

Using CLASSITEM is obviously a good work-around, but it would be useful to know what I'm doing wrong with the direct comparison.

Thanks!


texts: KML parsing error: parse error line 1, column 0. Not well-formed, invalid token

texts:
A week ago I opened an old .kmz file in google earth to add a few pin-drops. Everything saved correctly and updated for a good 3 days, then I started to get a parsing error in google earth upon opening the file. No idea what this is or how it developed its self, but I know absolutely nothing about how to fix these, I know nothing about programming or coding, and I have tried previous recommendations on the google groups help page with no progress made (https://groups.google.com/forum/#!forum/kml-support-advanced).

I was wondering if there was a detailed list of instructions on how to repair a file?


texts: ArcGIS online - How do I set-up the feature layer definition to allow me to truncate feature layers via REST API

texts:
I have written a script to automate the process of refreshing the data in a map in ArcGIS using R.

As part of this I have been attempting to use the ArcGIS online REST API to truncate a feature layer to remove all old data.

The idea I that this will be more efficient than the current method of retrieving all the orgID with the query API and then removing those ids with the deleteFeatures API (which currently works).

  truncateResponse <-
    httr::POST(
      url = paste0(featureLayer, "truncate"),
      body = list(
        f = "json",
        attachmentOnly = "false",
        async = "false",
        token = token
      )
    )

jsonlite::fromJSON(httr::content(truncateResponse))

which returned the following errors
$error
$error$code
[1] 403

$error$message
[1] "User does not have permissions to access this service"

$error$details
[1] "User does not have permissions to access this service"

https://developers.arcgis.com/rest/services-reference/truncate-feature-layer-.htm

Reading the information above, I have tried to update the feature layer definition using the admin directory.

I have changed "supportsTruncate" to be = true and added "truncate" to "capabilities" from what I can tell sync isn't enabled. However when I change it and update feature layer when i reopen the layer definition these have reverted back.

In summary, how do I set-up the feature layer definition to allow me to truncate feature layers via REST API?


texts: Census Data Intersection with Unique Boundaries

texts:
Basics: I have a country wide dataset of Census blocks, I need to find the population of unrelated boundaries that do not ALWAYS follow census blocks. I would like to use Select by Location-centroid as my method for determining what census blocks should be in the different boundaries.

Any tips on how to do this in a model?

Clarification

So I originally was intersecting my Boundaries (we will call them FBoundaries) with census Blocks to find the population of each of the fboundaries. However the fboundaries do not always follow the census blocks so I was getting double counts. So what I want to do is somehow tell the model to only take the census block if the centroid of the census block is in the Fboundary. Unfortunately I have the entire country I need to work with. And i'm lost –


texts: ogr2ogr not converting negative values when doing json to shp

texts:
I have converted a geoJSON file to shp using ogr2ogr, and everything is as expected - except any values that are negative in the JSON end up being positive once the file is converted to shp.

For example :

JSON : "-45" - Correct before converting

SHP  : "45"  - Wrong after converting

Here is the command I have used :

ogr2ogr -nlt POLYGON -skipfailures polygons.shp geojsonfile.json

Am I missing something? I looked in the documentation for ogr2ogr and I don't see anything about negatives. An actual example for one feature is below. Note the value that is "-7.5", but it is "7.5" after being converted to a shapefile. I confirmed this in QGIS.

{
    "type": "Feature",
    "geometry": {      "type": "Polygon",
      "coordinates": [
        [
          [-98.09436584736005, 29.62865606187322],
          [-98.09594335852961, 29.626871027805652],
          [-98.0970915224778, 29.62765563489956],
          [-98.09548731746852, 29.62942243552636],
          [-98.09436584736005, 29.62865606187322]
        ]
      ]
     },
     "properties": {
        "sweep": 0,
        "sweepTime": "2017-02-20T04:40:19Z",
        "elevAngle": 0.6893921,
        "value": -7.5,  // Does not convert properly as a negative value
        "radialAng": 218.172,
        "begGateRan": 10499.548,
        "endGateRan": 10749.536,
        "heightRel": 132.83063,
        "heightASL": 325.769
     }
   }


texts: How to convert latitude and longitude to x y coordinates (in meters)

texts:
I had an excel spreadsheet that included latitude and longitude coordinates for a series of points. I created a shapefile in QGIS from this data and selected the correct CRS (NAD83 / Massachusetts Mainland / EPSG:26986 / units = meters).

Now I want to export the data back into a CSV Excel file with the coordinates listed in meters (not latitude and longitude). But every time I right-click the vector file and Save-As, the WKT coordinates are displayed as latitude and longitude.

Is there something I'm doing wrong in QGIS?


texts: How do I populate a field in ArcMap (and Excel) with only a specific part of another field's attributes? For example: I want to populate the LATDEG field with only the degree part of a latitudinal co-ordinate and not the entire value.


texts:
I would like to create a postgresql function to correct geographic coordinates inside a polygon that are outside the -180 to 180 range of longitudes.

To do this, I thought I would create a function to loop through all the points in a polygon and do the correction.

However, I don't see a method for extracting the nth point in a polygon, only a linestring with ST_PointN.

Is this possible and/or am I going about this the correct way.


texts: Sampling random points from large raster file with replacement using R?

texts:
I have numerous large stacked raster file with multiple layers and I would like to select 250 random points and extract the data values from all layers for these points.

I had been using the raster package sampleRandom(raster,n, na.rm=TRUE, xy=TRUE) to select random points before extracting the data from my raster object but this works without replacement. I, however, would like to sample random points from the raster files with replacement as can be done with the r base package sample(x, size, replace = TRUE, prob = NULL).

I had considered just running a loop using sampleRandom so that each point has a chance of being sampled for each of the 250 runs;

samp_all <- matrix(, nrow = 250, ncol = 10)
for (i in 1:250)
{samp <- sampleRandom(layer1, 1, xy = TRUE, na.rm = TRUE)[, -3]
samp_all[i,] <- samp}
samp2 <- extract(stack_all, samp_all)

But this seems to run pretty slowly and I have quite a lot of files I would like to run this on.

Is there a simpler way to randomly sample points from raster layers with replacement that would allow me to extract data from my raster?


texts: How to measure orthogonal distance of line from point in QGIS?

texts:
As I am fairly new to QGIS I'm seeking your help.
I'm trying to measure the distance between points in a point Layer P and the end of lines in a line layer L. In L there are two categories (attributes) of lines, L1 and L4. Connecting pieces of L1 and L4 will always end at a point P, but they may be segmentes (meaning 2 parts L1 may connect to a part of L4 and after that a part L1 again before reaching a point P).

The task is to measure the distance from any point P along the L1 and L4 segments up to a distance of 500 meters. Thereafter I need to separate everything within the 500 meter margin from everything outside the 500 meters. A buffer will not do the job, since the distance is to be measured along the lines.

I'm thankful for any advice, since I got stuck very early on in this process.


texts: How to publish layer on geoserver using rest api with PHP CURL

texts:
I'm working in a project that I need to publish a layer automatically on geoserver. Searching I discover that the REST API can help me. Studying the REST API I saw that I need to use cURL to do that(the only example there), but I need the FILE FORMAT SHP and try to do a script with the cURL comands:

curl -v -u admin:geoserver -XPUT -H "Content-type: text/plain" -d "file:///home/Test_data/public_html/BRN_GIS/Shape_files/Links.shp" http://localhost:8080/geoserver/rest/workspaces/BRN/datastores/Roads/external.shp

and php code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/geoserver/rest/workspaces/BRN/datastores/Roads/external.shp");
curl_setopt($ch, CURLOPT_USERPWD, "admin:geoserver");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$data="file:///home/Test_data/public_html/BRN_GIS/Shape_files/Roads.shp";
if ($data != '') {
     curl_setopt($ch, CURLOPT_HTTPHEADER,
     array("Content-Type: text/plain",
            'Content-Length: '.strlen($data))
     );
 }
   curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
   curl_setopt($ch, CURLOPT_HEADER, false);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   $rslt = curl_exec($ch);
   $info = curl_getinfo($ch);
   echo $rslt;


texts: Popup is stationary does not move with the location

texts:
I am using the GeoExt example and used the same code in my application. This is my code

The problem I am facing is that the Popup box in my application on
 http://128.196.142.94/geo/test/test.html is stationary. Where ever you may click, the popup simply does not move. Not sure where I am going wrong?


texts: Can updates be made to "ogr_fdw" foreign tables in PostgreSQL?

texts:
I am accessing a Microsoft SQL Server table (w/ SQL Server a geometry column) via an ogr_fdw foreign table. SELECT statements work great, including the PostGIS functions that I've tried.

Are UPDATES (and INSERTS/DELETES) supported?

I receive an error:  ERROR: cannot update foreign table... ", is that a limitation of the ogr_fdw or fdw in general?

Or is it supported and I need to do additional configuration to the foreign table?

CREATE SERVER dev_db_server
  FOREIGN DATA WRAPPER ogr_fdw
  OPTIONS (
    datasource 'MSSQL:server=...',
    format 'MSSQLSpatial' );

CREATE FOREIGN TABLE xxxtable(
---
 )
 SERVER dev_db_server
 OPTIONS ( layer 'xxxtable' );

'2.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1'

'PostgreSQL 9.5beta2, compiled by Visual C++ build 1800, 64-bit'


texts: Select Elements tool not working in ArcGIS for Desktop?

texts:
I recently installed a copy of ArcGIS 10.2 on my personal laptop at home.  I'm a bit of a novice user.

I've connected the right folder on my desktop and been able to add shapefiles to my map.

The issue I have is that the select element tool does not work.  I cannot resize elements in layout view, anything I click just resizes the map.  I tried rebooting my computer. I tried restarting the application.  No dice.  No matter what I do if I am left clicking and move the mouse it zooms in (layout or design view) if I am right clicking it zooms out.

Anyone ever have this problem and have any suggestions?


texts: Legend title in print composer with different font styles

texts: I want to design a layout with print composer where the legend Title has two different font styles in one e.g. " I had it once but can´t remember". I would be grateful for help.


texts: Python function like SAGA Grid Gridding?

texts:
For a python script, I'm searching for a function that does the same as SAGA Grid gridding, an exponential interpolation on GeoPandas GeoDataFrame.

Does anyone know one?


texts:
I am working on a viewshed viewer application that uses ArcGIS' Viewshed Analysis example as a base. I have a calculator widget that takes coordinates and zooms to the specified location on the map when a submit button is pressed. The viewshed should then be calculated at that location. The SceneView has an event listener:
view.on("click", computeViewshed);

How do I simulate an "artificial" click using ArcGIS' API?


texts: Creating Color Ramp for Polygon Outlines in ArcGIS Desktop?

texts:
Within the properties (symbology tab) of ArcGIS-Desktop (10.2.2, Standard/ArcEditor license level), is there a way to color the polygon outline of a layer using a color ramp?

Using predefined color ramps it seems only the polygon areas can be filled and the polygon outlines are all colored in the same color (grey).

My goal is to have a transparent fill and only colored outlines based on a predefined color ramp without manually choosing the colors.

One possibility would be to assign the fill color to the outline and then remove the fill color. However, the problem still remaining is how to assign the fill color to the outline?


texts: QGIS modeler, putting string into the parameters does not work with a refactor field expression

texts:
Currently I am trying to do build a model with some string input parameters that are being processed in  a refactor field by an expression. However even though I clearly write some string text after doing the process it does not seem to work.

Here is the formula:
"RUP_" || "" ||  @NISCODE  || ""  ||   @Specialnummer  || "" ||   @Stamnummer  || ""  ||  @Volgnummer
What I am doing wrong here? And yes these are the names of the Parameters, even though there named differently in the screenshot, these are the ones I get in the field calculator.


texts: Proj4 inconsistent longitude after projection

texts:
All coordinates expressed in this question are (longitude, latitude), the default for proj4. London is at (-0.1460838, 51.5170986), and San Francisco is at (-122.419302, 37.775549). According to the proj4's geod program, the geographic bearing of San Francisco from London is -43.204268653666211719, and the great circle is 8624363.307m long.

To find out where San Francisco is on an Azimuthal Equidistant projection centred in London, I run the following:

cs2cs -I +proj=aeqd +lat_0=51.5170986 +lon_0=-0.1460838 +units=m +to +proj=lonlat
-122.419302 37.775549

And it gives me:

-5909365.29 6298188.68

Next, I transform these coordinates back to geographic coordinates:

cs2cs +proj=aeqd +lat_0=51.5170986 +lon_0=-0.1460838 +units=m +to +proj=lonlat
-5909365.29 6298188.68

And it gives me:

57d53'40.285"W 37d48'10.166"N 0.000

Which is a totally different location. Have I done something wrong to get this result, or is it a bug?


texts: How do I rectify a distorted aerial image in QGIS?

texts: When I place an aerial image in QGIS 3.4.15 it becomes distorted (in the attached the left image is correct, the right image is distorted).  How to I rectify this?


texts: Pure JavaScript Library for Geometry Operations

texts: Does anyone know of a pure JavaScript library for doing geometry operations such as buffer, union, intersects, etc? I want to play with doing these operations in the browser.  It looks like GeoScriptJS has some dependencies.


texts: How to indicate polygon vertices with small circles using OpenLayers?

texts:
I am using OpenLayers 3 and have more or less implemented everything in my requirements list, except one thing: I am asked to somehow make the polygon rendering indicate the polygon vertices with small circles.

In plain words, the desired polygon outline is not just a line - it is a line "adorned" with small circles in all the places where there is a vertex.

How can I do that in OL3? I searched in the ol.style.Style docs (that is, the style I pass via setStyle to the ol.layer.Vector containing my polygons), but didn't find anything relevant.


texts: How to obtain summary of overlapping vector layers by attribute (eg land use within properties) - QGIS

texts:
I am trying to determine a repeatable methodology for obtaining a land use change summary for a number of properties.
Inputs (both in same coordinate system):

Land Use Change shapefile with a number of different categories of land use change [field=type].
Property boundary shapefile

Desired output:

Add column to the property boundary for each land use type showing the
area of that [type] that falls within the property boundary.

Initially I just want to obtain the correct results, however it would be useful to learn the most efficient way of calculating this, as I will be working across a large area with many properties. I suppose it functions in a similar way to zonal statistics, however with two vector layers.
I have been able to undertake the analysis using the overlap tool, however this only works when splitting the Land Use shapefile into separate categories as their own shapefile, not analysing them all at once by attribute [type].
White border = property, polygons that fall within (light green [reforestation] and red [clearance]) are the LUC events


texts: Displaying Image Overlay in ArcGIS Runtime

texts:
TLDR; is there any way to display an image on a ArcGIS Runtime SceneView just like ImageOverlay, but without the use of ImageOverlay? (Long story in quotes)

I have an ArcGIS Runtime application written in WPF, which I need to
display a heatmap image. The image is calculated/generated on the fly,
and it's in the form of raw byte array (i.e. not as a file). As the
user interact with the application, the heatmap is recalculated (i.e.
a new heatmap is generated to replace the old heatmap). The
application operates in both 2D and 3D (user can switch between the
two), which means the application must be able to show the heatmap in
both MapView and SceneView.
ArcGIS Runtime 100.8 comes with a new useful ImageOverlay feature
(though I'm using 100.9). I could get it to work in a SceneView.
The implement for the MapView is different, since ImageOverlay is
supported only for SceneView. It is implemented using the
GraphicOverlay, with an Envelope geometry and PictureFillSymbol
symbol. As the PictureFillSymbol was designed to work with any
geometry with "fill" (including Polygon), the image ended up
repeating in tile inside the geometry. I had to change the
PictureFillSymbol.ScaleX and PictureFillSymbol.ScaleY properties
whenever the mapview's viewport (or scale) changes.
Subsequently, I realized that the application is crashing randomly
when I was navigating in a MapView. I made a new WPF project with a
basic MapView to duplicate the issue - it occurs randomly during map
zooming, with System.AccessViolationException:'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at
RuntimeCoreNet.GeneratedWrappers.CoreGeoView.CoreRT_GeoView_pulse(IntPtr thisHandle, IntPtr& outErrorHandle). I downgraded my SDK from 100.9
to 100.8 to see if there is similar problem. It generated errors in
100.8, but more types of exceptions are seen. As my previous SDK was at 100.6, I decided to test that, and it seems like the issue did not
happen at 100.6.
I had to roll back to 100.6, but ImageOverlay was introduced in
100.8. The method I used for MapView does not work in SceneView, because
it involves converting MapPoint of the Envelope's corners to screen Points
to calculate the rendered pixel size based on the geometry size on screen.
This will not work in a SceneView.
I'm trying to see if Raster and RasterLayer would work,
but my image is in byte[] form, with no georeferencing.
Is there other ways that I can implement my own ImageOverlay?


texts:
I would like to query features from a SHP vector that intersect with features from another vector.

Pseudocode:

 "Name"   IS  intersects( countries)

How would be the valid query composed?


texts: Write output of multiple files to a directory using glob.glob after processing?

texts:
I want to convert the data type (Int32 to Float32) of all the tiff images in a directory 'F:\\prep\\input\\' and save/write the outputs to a new directory 'F:\\prep\\converted\\'.

I have tried using gdal.Translate and glob.glob:

from osgeo import gdal
import glob
import os
data_to_process = glob.glob(os.path.join('F:\\prep\\input\\*.tif'))
for data_path in data_to_process:
raster_dataset = gdal.Open(data_path, gdal.GA_ReadOnly)
raster = gdal.Translate('F:\\prep\\converted\\*.tif', raster_dataset, outputType = gdal.GDT_Float32)


texts: How do I setup the initial entry point into the ArcGIS Geoservices REST API?

texts:
I am trying to implement the ESRI REST API with a non-esri service (MapProxy). I am able to add my service to ArcCatalog 9.3 as an 'ArcGIS Server'. However, none of the sample layers are displayed when I connect.

URL:

http://host/services/arcgis/

Start response:

start_response('200 OK', [('Content-Type', 'application/json')])

This returns JSON (as in the example)

{
  "currentVersion": 1.0,
  "services": [
    {
      "name": "Anaheim",
      "type": "FeatureServer"
    },
    {
      "name": "Switzerland",
      "type": "FeatureServer"
    },
    {
      "name": "USA",
      "type": "MapServer"
    }
  ]
}

How do I successfully setup the initial entry point (Service Catalog) into the ArcGIS Geoservices REST API?


texts: Using Python Function in Field Calculator to find numbers

texts:
Disclaimer, I am terrible at writing my own functions especially in the field calculator. I have an address field (Address) with records that are missing street numbers. I would like to find these records, skip over them, and populate a field (Number) with the first element of the records that do have a street number. I would like to do this in the field calculator if possible (ArcMap 10.2.2, Basic).

Here's what I got so far:

def findNumbers(Address):
  if Address.split(" ")[0].isalpha():
    pass
  elif int(Address.split(" ")[0]) >= 0:
    Number = Address.split[0]

Number =
def findNumbers(!Number!)


texts: GeoServer - Render style of points based on URLs saved in a field of the table using YSLD

texts:
I am new to styling in GeoServer and was wondering if there is a way to style points in a table based on the external URLs defined in one of the fields in that table.

Let's say I have a table in PostgreSQL with 100 points and a field (e.g. link) of that table has the URLs of the images that I want to use to style these points in GeoServer. One unique URL can be used across multiple points and the 'link' field will define what image to use for what point.

I cannot use filter rule because we want to keep the style dynamic in the sense that if a new point is added that has a new image URL, Geoserver should just style it based on the URL in the field rather than defining a new filter rule in the style for that new image.

EDIT:

Here is the code sample I tried but it shows the points as grey squares and not the actual image

name: Default Styler
title: A boring default style
abstract: A boring default style
feature-styles:
- name: name
  rules:
- name: Rule 1
  title: RedSquare
  abstract: A red fill with an 11 pixel size
  scale: [min, max]
  symbolizers:
  - point:
      size: 15
      symbols:
      - external:
          url: ${marker_url}
          format: image/png

Here is the example of the attributes of the points

|id|marker_name |  marker_url|

|1 |Cat         |  https://homepages.cae.wisc.edu/~ece533/images/cat.png
|2 |Mountain    |  https://homepages.cae.wisc.edu/~ece533/images/mountain.png
|3 |Watch       |  https://homepages.cae.wisc.edu/~ece533/images/watch.png


texts: How to render an SVG from PostGIS using ST_AsSVG

texts:
Speaking with a cartographer from National Geographic last night, my interest was again piqued (peaked?) in an open-source map publishing toolset built on PostGIS and Inkscape (as per his workflow and how others use Illustrator with Avenza Map Publisher using ArcGIS data)

With the PostGIS ST_AsSVG command, I'm not sure how to work with the output as an SVG file. I can see in other discussions that SVG's can be exported somehow, but I'm not sure how that works exactly.

With that said, assuming it's perhaps just a matter of orienting the command to export a static SVG file - would/could it even be possible for Inkscape to read an SVG directly out of PostGIS?


texts:
How can we tag schools? One problem is that they are based on large areas, and there are entrances and barriers.

How can we handle footways or all the parts of a footway or service road from the main road network so that it is possible to route to the entrance of the school. Any ideas here?

Is it right that generally speaking school buildings can be tagged with building=school?


texts: In ArcGIS 9.3, how do I split a 3-band raster (.tiff) file and summarize the band values?

texts: Using ArcGIS 9.3, I would like to make a new, single-band raster file that includes only one value: a summary of the three existing bands. The composite band is currently a composite .tiff file. Something like Band1 + band2 + band3 = newValue , for each pixel in the raster.  The new raster would contain only one output band, with the values for that band = newValue.


texts:
I know there are several post already on how to convert OSM to GeoJson, e.g., How do you convert OSM XML to geojson?.

Nevertheless, I tried the mentioned tools, but I always end up with the same problem. Whenever I load the converted GeoJson (http://tyrasd.github.io/osmtogeojson/) or load the OSM data directly (using geojson.io -> Open), I receive an invalid shape:

http://bl.ocks.org/d/5fc3e8038fa1101cdcd51ad3d0404b47

With http://geojsonlint.com/ I receive different errors using the result of the conversion (e.g., the first and last positions in a LinearRing of coordinates must be the same or Polygons and MultiPolygons should follow the right-hand rule). Is there any setting, tool, that may solve these problems? Or generate a valid result? Are there any tips for the OSM data, that I may apply (e.g., remove specific features, nodes, ...). The source data is shown correctly in OSM, see http://www.openstreetmap.org/relation/62780.

The complete OSM file used for conversion can be found here on my GitHub:
nuernberg.osm


texts: Using QGIS to access data delivered by ArcGIS for Server?

texts:
Can I use QGIS to access data delivered using ArcGIS Server?

The following servers don't seem to be compatible with QGIS

http://www.topofthesouthmaps.co.nz

http://gis.wcrc.govt.nz/arcgis/rest/services


texts: Filter image collection with a date list in Google Earth Engine?

texts:
I know how to filter with a date range in Google Earth Engine, but I would like to filter a list of concrete dates which aren't consecutive, single days, for example, ['2005-08-05','2009-09-01','2017-02-08'].

var collection = ee.ImageCollection("MODIS/MYD11A1").select('LST_Day_1km');

var reference = collection.filterDate('2016-01-01', '2016-12-31')


texts:
I am using GRASS GIS 7.0.3 on linux, however I've been trying to install the r.green extension on GRASS and always get the error message:
"ImportError: cannot import name set_path"
"WARNING: libgreen and libhydro not in the python path"
The repository is: https://svn.osgeo.org/grass/grass-addons/grass7
I have been using GRASS for several years and never had any issues on installing extensions before.
I have little to zero knowledge on python but based on the error message, I suppose there is a missing scripts on the repository?
Is there anyone else here experiencing similar issues? or had managed to solve this issue?


texts: Moving Polygons with snap from edge to edge using ArcGIS Desktop?

texts:
I have such a basic question, but can't find any solution. I have some hundred rectangular Polygons and want to move them to other, already existing Polygons. The borders of these polygons should MATCH each other, so I need a snapping option.

If I try to use ArcGIS Desktop and activate the snapping, it only snaps the center point (black circle in the pic) to the borderline of existing parcels (left red line in the pic).

However, I want that the EDGES (both red lines in the pic) snap to each other. After hours of trying and searching, I can't find any solution.


texts: How to display OSM relations in Openlayers with tags as legend?

texts:
I would like to show this type of relations in a simple map with Openlayers.
http://www.openstreetmap.org/api/0.6/relation/1637735/full

I'm specially interested in being able to show tags as legend. Do you know how can I do it in the simplest way possible?

I'm not sure if Openlayers has already a package to display relations.


texts: Can Tiff files from ESRI Geodatabase be loaded into QGIS

texts:
I have been able to load an ESRI geodatabase which contains shape files into QGIS, however when I try to load a geodatabase containing tiff files I get an error message saying ...."is not a valid or recognized data source". I am assuming it is because it is tiff files? Is there a way to get the tiff files loaded into QGIS through a geodatabase or is there a format I can convert the tiff files to before I put them into the geodatabase? Any suggestion welocme

Nigel


texts: 3-D Terrain effects for vectors in QGIS?

texts:
I'm a bit new to QGIS, and making a few maps of roads through mountains. I'm looking to have a 3-D effect within my 2-D map.

I got a DEM, made a hillshade, and blended a basemap over it.  Nice tutorial for this

My raster has a nice 3-D effect of the terrain. Is there someway to get the same for the vector layer i.e. roads. as you can see in the image the road doesn't seem to be fitted/adjusted to the terrain.

I searched a bit got some clues of v.drape (couldn't get it to work) not even sure if it'd do what I want. And I believe 2.5D symbology is for polygons only. Kinda need some way to embed the Z values in the road shapefile or something similar.


texts: Error getting ESRI Shapefile driver OGR in C++

texts:
I am unable to create an OGR Layer using the C++ API. I have followed the documentation at this link exactly http://www.gdal.org/ogr_apitut.html
I get an error trying to get the shapefile driver. Any suggestions?
    const char *driverName = "ESRI Shapefile";
    GDALDriver *pDriver;

GDALAllRegister();

pDriver = GetGDALDriverManager()->GetDriverByName(driverName);
if (pDriver == NULL)
{
    qDebug()<<"Error loading driver"; // this error happens
}


texts: Meaning of legend value in Kernel Density?

texts: I have done some analyses on the spatial distribution of traffic signs using kernel density, I used SQUARE_KILOMETERS in area unit, the output is good and clear, but I don't understand the meaning of the legend.


texts: Calculate text field based on codeblock query of numeric field

texts:
I am trying to populate a field with a L/R bank designation based on a route measure (as part of a larger script), but I am struggling. I have a shapefile created (tir_pts_lyr), I have a blank column (L_R_Bank), I have the measure value column (M_off_str). So if the measure value is negative, I want "L_R_Bank" to be populated with an "L", if the measure is positive, an "R", and if zero, a "C".
I'm trying to use the sample codeblocks in the ArcHelp, but they are lacking in detail for my knowledge level.  I have no clue what to put in the expression field for getClass and how the next codeblock line relates to that. Any hints for a newbie.

#calc left/right bank using M-distance measure
# Set local variables
inTable = "tir_pts_lyr"
fieldName = "L_R_Bank"
expression = "getClass(float(!SHAPE.M_Off_str!))"
codeblock = """def getClass(M_Off_str):
    if M_Off_str < 0:
        return "L"
    if M_Off_str > 0:
        return "R"
    else:
        return "C" """
#Execute CalculateField
arcpy.CalculateField_management(inTable, fieldName, expression, "PYTHON", codeblock)


texts: JSON format unavailable for GetFeatureInfo service

texts:
I have Geoserver 2.2.4 installed - which allows GetFeatureInfo to be returned as json

If I make the following call

http://[servername]/geoserver/[namespace]/wms?LAYERS=[layername]&QUERY_LAYERS[layername]&STYLES=&SERVICE=WMS&VERSION=1.3&REQUEST=GetFeatureInfo&BBOX=299856.403448%2C528892.700948%2C300279.736552%2C529316.034052&FEATURE_COUNT=10&HEIGHT=600&WIDTH=600&FORMAT=image%2Fpng&INFO_FORMAT=application%2Fjson&SRS=EPSG%3A27700&X=249&Y=447&EXCEPTIONS=application%2Fjson

I get a exception response of

Invalid format 'application/json', supported formats are [text/plain, application/vnd.ogc.gml, application/vnd.ogc.gml/3.1.1, text/html]

I have checked getcapabilities for this service and only the following are available

<GetFeatureInfo>
    <Format>text/plain</Format>
    <Format>application/vnd.ogc.gml</Format>
    <Format>application/vnd.ogc.gml/3.1.1</Format>
    <Format>text/html</Format>
</GetFeatureInfo>

So is there any extra config I need to do to Geoserver to get it to output in json for GetFeatureInfo?


texts: Import UTF-8 encoded Shapefiles into SQL Server?

texts:
I am trying to load a shapefile to SQL Server, using ogr2ogr and Shape2SQL tools. The shapefile uses UTF-8 encoding, specified in a .cpg file, and confirmed when opening the file with QGIS.

However, as this post explains:
Which character encoding is used by the DBF file in shapefiles? The .cpg file only applies for data, not column names. So both tools (ogr2ogr and shape2sql) fail when reading the file due to that reason.

I have tried converting the .dbf file to various formats (from plain ascii, to utf8 without bom, to utf8) using Notepad++ but with no results.

Is there any semi-automatic way to convert the column names to their latin equivalent, or force either of these programs to read column names in utf8?


texts:
I Started this yesterday and I was able to create the shapefile in QGIS but I need the projection to be in NAD 83 New Jersey State Plane (ft) Coordinate System, which I was able to change the layer into NAD83NJ.

The problem is the only base layer I found was the Google/Bing Satellite Imagery which is in WGS 84 / Pseudo Mercator. How can I get the shapefile into NAD83NJ so I can see the shapefile has the correct coordinates?

This is in QGIS 2.6.1


texts: ArcObjects : How to change layers connection properties without losing joins

texts:
I'm using arcObjects 9.2.6 java librairies to change connection/path properties within a java prog.
This prog aims to change path and connection properties for all layers of an mxd file.
It works well with Layers wich use Shape file.
It also works well with layers from Database whith no joins. However when a joins to another table exists on layers it does not work.

what i do for database layers is :

dataSetName = datasetName.getName();
propertySet = (IPropertySet) new PropertySet();
propertySet.setProperty(SDE_SERVER, properties.get(SDE_SERVER));
propertySet.setProperty(SDE_INSTANCE, properties.get(SDE_INSTANCE));
propertySet.setProperty(SDE_DATABASE, properties.get(SDE_DATABASE));
propertySet.setProperty(SDE_USER, properties.get(SDE_USER));
propertySet.setProperty(SDE_PASSWORD, properties.get(SDE_PASSWORD));
propertySet.setProperty(SDE_VERSION, properties.get(SDE_VERSION));
workspaceNameCible = (IWorkspaceName2) new WorkspaceName();
workspaceNameCible.setWorkspaceFactoryProgID(SDE_SOURCE_ID);
workspaceNameCible.setConnectionProperties(propertySet);
datasetName.setWorkspaceNameByRef(workspaceNameCible);
if (dataSetName.contains(".")) {
  datasetName.setName(dataSetName.replaceAll(dataSetName.substring(0, dataSetName.indexOf(".")), properties.get(SDE_USER).toString()));
}

This correctly changed the connection information of the layer but not the joins.

For example if my layer contains a join on a table identified by sde_user.my_table
and i execute the code to change the sde_user to sde_user2, the layer will have sde_user2 but the joins still remains on sde_user.my_table (where i expect sde_user2.my_table).

I've searched how to get the joins from the layer and see if it is possible to change their connection properties but i've found nothing.

Any suggestions ??


texts:
I got a Feature class with some identicial fields! Now i only need one polygon which had the same ID and this is the one with the largest size? Is there a posibility to delete the Polygons which are identical by size so that only the largest Polygons(from the ones with the same ID) are left?

For example:

ID   shape area

1    5
2    4
2    3
3    11
4    7
5    8
5    10

and i Need only the Polygons with the largest size that means the frist, second, fourth, fifth and the last!