texts: How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

texts:
I'm trying to generate a shapefile of random points using FID from the attribute table.
My attribute table has 800,000 features and I only need a sample of 240.

Is there a way to do it in arcpy or in the field calculator?


texts: Keep direction information after intersect operation with fishnet

texts:
I will try my best to describe my question here:
All the operations are done with ArcMap 10.1.
I have a shapefile, which represent the stream segment network of a watershed produced from ArcHydro tool.

I need to break each stream segment into reaches with a fishnet using intersect tool.
After the intersect operation, one single stream segment is represented by several reaches.
However, the original stream segment has attributes named "from Node" and "to Node". After intersection, all reaches are seemly the same in attributes and I can't tell the sequence of them at all.

So how should I rebuild the direction information for these stream reaches?


texts: QGIS: Creating a layer group in a geopackage: to group layers and tables with a value relation

texts:
Currently I have all my layers and tables group inside a geo package, these also have some style settings including value relations to have choice lists with multiple choices and filtering.

The problem is when you load the layer in separately even with that style at default, the value relation is lost. To remedy this I want to group certain layers with there tables so that they cannot be loaded in separately by accident.

So how do I group my layers and their respective tables together into this geopackage?


texts:
I'm trying to simply get the Difference between two sets of lines, but the algorithm  returns a copy of either one, depending of the combination of INPUT/DIFFERENCE layer I try. Never the difference.

Both of my shapefiles are in the same projection, and have been cleaned (v.clean).

I tried to dissolve them, but no luck.

Any ideas?

(Using QGIS 2.18.1 over Win7)

Here is a picture of the situation. I have 2 sets of roads (red and green). The green network overlaps everything from the red one, but has some other roads in it. I'm trying to get a shape of these extra segments (hence, the Difference). But the result gives me either an exact copy of the red or green network.


texts: Does anyone know if there is an Arcpy function to set a scale range?


texts: Multiple themes in QGIS defaulting to first theme

texts:
I've been trying to use the themes options in QGIS.

In the window mode they work just quite well and layer format changes.

But when I go to the layout print menu the themes show up but it keeps defaulting back to the first theme.

My question is, Is there a way to different themes in the layout window or have I missed a step.

I suspect it's a bug in QGIS - I'm using Version 3.10.


texts: Generate a game world using planet.osm (in .pbf format)

texts:
I've recently downloading openstreetmap's Planet.osm for use in an experiment whereby I plan to generate a video game world based off of the planet. openstreetmap's wiki hasn't been very useful, and all I really want to perform is.

To start off, the simplest thing I want to do is:

Create a text file, whereby each character corresponds to a point in planet.osm.pbf, with;

Water = 0;
Land = 1;

That's all I need to start.


texts: Migrating US Census GDB file to PostGIS -- ERROR: tables can have at most 1600 columns

texts:
I'm working with data from the American Community Survey, provided by the U.S. Census. Specifically, I've downloaded gdb files from here.

I have the gdb file ACS_2016_5YR_TRACT.gdb on my server and I'm attempting to create a psql table with the following:

ogr2ogr -f "PostgreSQL" PG:"host=host port=5432 dbname=db user=user password=password" ACS_2016_5YR_TRACT.gdb -overwrite -progress --config PG_USE_COPY YES

The output I get when running the above is a CREATE TABLE command with over 1600 columns which it tries to execute but fails with:

ERROR:  tables can have at most 1600 columns

Has anybody had success loading ACS5 data onto PostGIS? How could I get around this?

I have to imagine this is a common use case for people working with census data... I'm wondering if there is a way to pass flags to ogr2ogr that would allow it to partition the data? Maybe there's a way to increase the column limit in postgresql? I've tried changing the db settings and recompiling, as suggested in other answers, but haven't had much luck. I'm not sure if that's the best way to go about it though.


texts: Use PyQGIS to import CSV and draw points using different color

texts:
A CSV file contains columns latitude, longitude and color.

uri = "file:///C:/data/balls.csv?type=csv&xField=longitude&yField=latitude&spatialIndex=no&subsetIndex=no&watchFile=no"
vlayer = QgsVectorLayer(uri, 'Balls', "delimitedtext")

Using the Python console in QGIS, how can we draw each row in the CSV as a point whose color depends on the value in the color column of the imported CSV?

It's my understanding that QgsDataSourceURI.setDataSource() can do such a WHERE query during the import, but only works on PostGIS.


texts: Add multiple polyline attributes to one polygon layer

texts:
I am trying to join multiple polyline attributes that intersect with a buffer polygon. In the picture below you can see buffers i have created which are actually intersection buffers. Around it are the poly-lines which are streets with information about traffic volumes. I want to add all the traffic volume information to the polygon. For example: intersection buffer 312 is connecting four streets with traffic volumes of 250, 3500 and 2600 (see image below). Intersection buffer 176 has two streets intersecting to it with traffic volumes of 1600 and 800. I want to populate all the street volumes (that are intersecting with the buffer) in the attribute table of the intersection buffer.

I have tried to use spatial join tool, plus using the usual join-relates to achieve this but its giving me only one traffic volume value in the attribute table. How can I have all the traffic volumes of the street intersecting with the buffer in its attributes table?


texts: Digitizing historical Brazilian map in QGIS3.4

texts: I am trying to overlay a map of a historical boundary (in .tif format) onto a Brazilian shapefile with subnational administrative boundaries. My general question is: what is the most direct (and reliable) way to transform my figure into a polygon onto my shapefile, based on the geographic features?


texts: How to test the geometry type from a list of layers and then join it with PyQGIS 3

texts:
Summarizing my problem, I'm a beginner and I'm developing a plugin that will be able to do several spatial joins. For this, it will have to separate the spatial from the non-spatial layers and do the spatial join between them.
I've a list of layer names from this code:

layerList = QgsProject.instance().layerTreeRoot().findLayers()
nlist = []
for layer in layerList:
    nlist.append(layer.name())

hence I do the geometry test:

layer = iface.activeLayer()
features = layer.getFeatures()

for feature in features:
    # the geometry type can be of single or multi type
    geom = feature.geometry()

    if geom.type() == QgsWkbTypes.PointGeometry:
        print("point")
    elif geom.type() == QgsWkbTypes.LineGeometry:
        print("line")
    elif geom.type() == QgsWkbTypes.PolygonGeometry:
        print("area")
    elif geom.type() == QgsWkbTypes.UnknownGeometry:
        print("table")

and finally I do the spatial join:

root = QgsProject.instance().layerTreeRoot()
ids = root.findLayerIds()
target = QgsProject.instance().mapLayer(ids[1])
print('target: ', target.id())
layerToJoin = QgsProject.instance().mapLayer(ids[0])
print('layerToJoin: ', layerToJoin.id())
fieldToJoin = QgsProject.instance()
symb = QgsVectorLayerJoinInfo()
symb.setJoinFieldName('id_feature')
symb.setTargetFieldName('id')
symb.setJoinLayerId(layerToJoin.id())
symb.setUsingMemoryCache(True)
symb.setEditable(True)
symb.setDynamicFormEnabled(True)
symb.setUpsertOnEdit(True)
symb.setPrefix('')
symb.setJoinFieldNamesSubset('')
symb.setJoinLayer(layerToJoin)
target.addJoin(symb)

Separately, each code block works fine, but I need to put all together and I doesn't figure how. First issue the QgsProject doesn't have a geometry method, so I can't iterate in the layer list and test the geometry, that way I can't direct a vector layer and postgresql table to do the spatial join.
If anyone has an idea or a better way to do this please help!!!


texts: What are opportunities available and skills needed for career in GIS?

texts: I am currently doing my MS software engineering. I am very much interested in GIS. I would like to know about the various opportunities available in this field and also the skills that I will have to acquire to enter into this field. I would like it to be software related.


texts:
Having two raster maps as the examples below:

We are interested in evaluating their similarities. As shown, they are not fully overlapping. We guess one way is to clip small one area from the bigger one, therefore there will be two same size raster maps, e.g., arrays. So we may use pixel-wise correlation to find out how similar they are.

The existing issues/difficulties are:
1) The resolution of the two raster maps are not the same. So even for the above idea there is a problem of point-wise proceeding.

We wonder to know:

  1) a better way to find their similarities as human-eye (+brain) does,
  that is, there is absolutely high similarity in the trend of spatial
  variation in the two maps.
  2) if pixel-wise correlation is OK for our
  purpose?

EDIT
Think this way: image one as a matrix of size mxn and image two as a matrix of size pxq. A bounding box for matrix one is {x1,y1,x2,y2} which mean regardless to image one resolution its dual matrix (one) must fit the bounding box perfectly. The same scenario for image two and so matrix two. Note that their bounding boxes are also different. Thus this first stage is to stretch matrices to fit their dual bounding boxes. How to do this job while not using any image manipulation software? We prefer to do it using Python + Numpy (Scipy). The second stage is to resample each stretched matrix to a unique dimensions. This makes it possible to do element-wise operations on both matrices. How to do this? We are mostly concerned in the algorithms. You may notice that since the final comparison will be element-wise thus both the above stages must be properly chosen to avoid any distortion (change in the data). We are looking for some algorithms to handle all the above to result something that visually we see in terms of relationships in the two images (matrices).


texts: Encode an azimuthal equidistant projection in NetCDF conversion

texts:
I'm trying to do Azimuthal Equidistant in CF-compliant NetCDF, but I didn't get the correct projection.
If you compare the first two information (gdalinfo) you see there is no AUTHORITY and also PROJCS, GEOGCS, DATUM, SPHEROID are unknown.

I followed this link to set the set the projection:
Mapping from CF Grid Mapping Attributes to CRS WKT Elements

This is the original projection which I want to save it to NetCDF.

Size is 8000, 8000
Coordinate System is:
PROJCS["Azimuthal_Equidistant",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Azimuthal_Equidistant"],
    PARAMETER["latitude_of_center",53],
    PARAMETER["longitude_of_center",24],
    PARAMETER["false_easting",5837287.81977],
    PARAMETER["false_northing",2121415.69617],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (4800000.000000000000000,1800000.000000000000000)
Pixel Size = (75.000000000000000,-75.000000000000000)

and this is what I got:

Size is 8000, 8000
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["unknown",
        DATUM["unknown",
            SPHEROID["Spheroid",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Azimuthal_Equidistant"],
    PARAMETER["latitude_of_center",53],
    PARAMETER["longitude_of_center",24],
    PARAMETER["false_easting",5837287.81977],
    PARAMETER["false_northing",2121415.69617]]
Origin = (4799602.500000000000000,1800037.500000000000000)
Pixel Size = (75.000000000000000,-75.000000000000000)

here is the code that I extracted the projection:

# Extract Projection info from tiff
ds = gdal.Open('sample.tiff')
prj = ds.GetProjection()
srs = osr.SpatialReference(wkt=prj)

# Create container variable for CRS
crso = nco.createVariable('crs', 'i4')
crso.grid_mapping_name = 'azimuthal_equidistant'
crso.projected_crs_name = srs.GetAttrValue('PROJCS')
crso.geographic_crs_name = srs.GetAttrValue('GEOGCS')
crso.horizontal_datum_name = srs.GetAttrValue('DATUM')
crso.latitude_of_projection_origin = srs.GetProjParm('latitude_of_center')
crso.longitude_of_projection_origin = srs.GetProjParm('longitude_of_center')
crso.false_easting = srs.GetProjParm('false_easting')
crso.false_northing = srs.GetProjParm('false_northing')
crso.longitude_of_prime_meridian = 0.0
crso.semi_major_axis = 6378137.0
crso.inverse_flattening = 298.257223563

Does someone know how to get the correct projection?


texts: Converting data.frame with no lat-long info to raster using R?

texts:
I need to read in a .txt file into R and later do some spatial analyses on it.
I’m working in R. 3.0.2 on a Windows server.
I load the following libraries (probably more than I need):

  library(raster)
  library(rgdal)
  library(rgeos)
  library(sp)
  I then read in the text file:
  v2<-read.delim("E:\GIT\GEO_04_Research\03_Fire\03_FireIASI\Data\fire\GigGFEDRedownload\GFED3.1_199902_BA.txt", header=FALSE, sep = "",  dec = ".", strip.white=TRUE)
  This works fine and
  str(v2)   #tells me 'data.frame':  360 obs. of  720 variables.

However, there is no xy information.  The documentation on this data layer states this data runs from a top-left of 179.75W, 89.75N to the lower right corner at 179.75E, 89.75S, with each reading in this regular ‘grid’ occurring at 0.5 degrees.

So I created a raster to match these specifications:

  gfed<-raster(ncol=720,nrow=360,xmn=-89.75,xmx=89.75,ymn=-179.75,ymx=179.75)
  gfed… # tells me:
      class       : RasterLayer
      dimensions  : 360, 720, 259200  (nrow, ncol, ncell)
      resolution  : 0.2493056, 0  (x, y)
      extent      : -89.75, 89.75, -179.75, 179.75  (xmin, xmax, ymin, ymax)
      coord. ref. : NA

But now how do I get the xy information from the ‘gfed’ raster onto the values in the data ‘v2’?

I tried ‘stack’ hoping it would take the ‘square’ data.frame onto to the gfed raster, but I get 0 layers.  I’m new to coding and I suspect that this requires some loop that reads row 1 from 1-720 and then goes to the next row until it reads all 360 rows.

I think part of the problem is that the data.frame ‘v2’ doesn’t have any spatial information associated with it, so SpatialPixels and SpatialDataFrame options don’t work – or at least, I can’t get them to work.

I just can’t get passed this point.

I'm almost there with your solution of using 'scan' into a newly created raster.  It is a bit embarrassing to admit – I understood that my co-author on this was sending ‘world-wide’ files at half-degree scale, and previous data have been just that, and so I accepted that even though I looked at the data and saw co-ordinates that didn’t start at -180, +90.  The study area is actually southern Africa (approximately xmn=13, xmx=36, ymn=-36, ymx=-18) and it is at a quarter-degree (0.25) scale!
I thought I’d be very clever and apply your solution (make grid and then scan the data in to the new grid) with these southern Africa parameters.  I couldn’t get it to work and after spending time staring at the data, I realised two things:

The points don’t start neatly at round numbers.  I applied shifts separately to the x and y.

Then I realised that the data that has been sent to me is an irregular grid.  It is not consistently 0.25-degrees.  It is in general has a 0.3-degree sized grid cell followed by a 0.2- degree sized grid cell followed by another 0.3- degree sized grid cell.

Any idea how I read/scan data from an irregular ‘grid’ into a nice neat 0.25 grid that I have made.  I have now made

  southernA<-raster(nrow=72, ncol=92, xmn=13, xmx=36, ymn=-36, ymx=-18)

I guess I would like R to ‘resample’ the ‘nearest-neighbour’ grid from the irregular grid into my newly created, regular grid called southernA.

Someone asked what the data is all about:  we are looking to see how much biomass burning contributes to CO in the atmosphere.  I used to do a lot of fire ecology work for a conservation agency that I worked for.  I still dabble in the field.   I’d be happy to post a copy of the irregular grid data if that would help find the solution.


texts: Can we say ECEF datum like in Geodetic datum?

texts:
Commonly we use geodetic datum to describe the geoid, a distorted ellipsoid model of the Earth, but is it correct to say Earth-Centered Earth-Fixed (ECEF) datum?

Because we are applying ECEF to a sphere model of the Earth.  Datum is the applied model, such as sphere, ellipsoid, or geoid.


texts: ModelBuilder Projection Error (invalid extent for output coordinate system)

texts:
I have many point shapefiles all in WGS84 and I need to project them to different Coordinate systems. Every shapefile has only one point with its coordinates and the EPSG number for which the point is to be projected to.

So I've created a little Iteration in the ModelBuilder.

The Value is stored as "Coordinate System".
But unfortunately I get the following error at the projection part.

Executing (Project): Project D:\David\Verarbeitete_Daten\Preprocessing\koord_Select\Wtrsh_9.shp D:\David\Verarbeitete_Daten\Preprocessing\Koord_proj\Wtrsh_9.shp PROJCS['WGS_1984_UTM_Zone_60N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',177.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]] # GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]] NO_PRESERVE_SHAPE # NO_VERTICAL
Start Time: Wed Apr 18 11:53:55 2018
ERROR 999999: Error executing function.
invalid extent for output coordinate system
Failed to execute (Project).
Failed at Wed Apr 18 11:53:55 2018 (Elapsed Time: 0.01 seconds)

What is the reason for that?


texts: Modifying center of equirectangular world map in QGIS?

texts:
I'm trying to make a custom CRS in QGIS, to get a projection similar to this map, where Toronto is at the center of the map :

The picture above was created with an online tool : worldmapcreator

But I can't get enough details with this tool, that's why I need a way to project a similar map in QGIS.

I tried to create a custom CRS, but I'm not a geographer...
I'm not familiar with proj4 language and I struggle a lot.
I only managed to change the central longitude on a WGS 84 projection, but I can't move the equator.
The only time I was able to put Toronto at the center was in a circular map, but I need an rectangular map...

So, what parameters should I use to get a projection featuring :

the whole world in a equirectangular map
Toronto at the very center of the map

I don't care about the distortions at the top and bottom of the map.


texts: Setting a buffer around a road and visualizing it in QGIS

texts:
So i need to set a 30 meter Buffer around a road in a Layer and visualize it in QGIS. The road is split in 8 segments( don´t think it makes a difference).

Tried this code:

select a.ref, a.geom, st_buffer(a.geom, 30)
from au.roads a
where a.ref='A306'

When i load it in QGIS it doesn´t show a Buffer around that road. What am i doing wrong?


texts:
I have an Access database(.mdb) and I want to create a shape points from this database by using a library of GeoPandas. My script is working properly, but recently I encountered this problem after re-installation of GeoPandas

error messages : pyproj._data_dir does not export C function pyproj_context_initialize

How can I fix this error which resulted in importation of GeoPandas?


texts: Debug Form.py files with Pydev and Qgis debug plugin

texts:
Following Python Qgis cookbook, qgis doc and other usefull docs, I succesfully installed and configure the debugger for pluggin as "hello world".
But, in the case of specific form, based on python script and Qt .ui files, I cannot figure out how to debug with the Pydev debug server.

I did :

run the debug server and the qgis plugin
set the python file path on Qgis
set the python file path on Pydev project,
set a breakpoint on def formOpen(): function
open the form under Qgis

The debugger never stop on the breakpoint.


texts: Communication Between Browser and QGIS Server/QGIS API

texts:
Suppose I have QGIS server up and running with some vector data. Now a user accesses this data from a webpage. Would it be possible in some ways for the user to send a request to the QGIS Server and make it do some Vector Geo-processing at the server side and return the results? (For example user sends a select query on a point layer. The Server will calculate the Convex Hull and return the WKT.)

As per the QGIS website,

  QGIS Server provides a web map service (WMS) using the same libraries
  as the Quantum GIS (QGIS) desktop application.

If it is not possible at present, would it be possible to create something like a REST service(i got the term from ArcGIS REST API) which can hold communication between user and QGIS server? What are the difficulties in implementing them?


texts: How to visualize PostGIS data(geography) in QGIS?

texts:
I've created a table that stores spherical circles located all over the globe. But I'm not able to view this data in QGIS.
This is my table:

CREATE TABLE circles(gid serial PRIMARY KEY, the_geog geography(POLYGON,4326) );

I've inserted the data like this:

INSERT INTO circles (gid, the_geog) VALUES (1, geometry(ST_Buffer(geography(ST_GeomFromText('POINT(48.732084 -3.459144)')), 1000)));

I'm getting this error in the console:

dbname='TestGIS' port=5432 sslmode=disable table="public"."circles" sql= is an invalid layer - not loaded

Can anybody explain what I'm doing wrong ?


texts: Leaflet polygon labels not showing when pathOptions(clickable = FALSE)

texts:
I am creating a Shiny app which contains a Leaflet map. The purpose of the map is to select a polygon by clicking on the map, and then to draw a choropleth of results for the selected polygon. Subsequent map clicks select a second polygon and draw a choropleth of the results for the second selected polygon. There are some other layers included in the map which means that the map pane structure is fairly complex and the choropleths are low down in the order for display purposes.
I would like to add some mouse-over labels to my choropleth polygons. However, I've found that because the choropleth polygon layer is far down in the map panes, the labels are covered up by the layers above. To get around this I can add a transparent version of the polygons with labels in one of the top map panes. This works fine when the layer is set as clickable = TRUE but when clickable = FALSE the labels no longer work. I can't leave them as clickable = TRUE as this means selecting a polygon by clicking on it no longer works where there is a (transparent) choropleth polygon drawn.
Sorry I can't provide my whole code or data, but this is the snippet for the section which does what's described above. I'm happy to clarify other parts if needed.
proxy <- leafletProxy("map", session) %>%
                addMapPane("labels2", zIndex = 410) %>%
                addMapPane("area2", zIndex = 403) %>%
                addPolygons(data = results_area2, #choropleth 2 labels
                            label = ~results_area2$labelContent,
                            fillOpacity = 0.0,
                            opacity = 0.0,
                            options = pathOptions(pane = "labels2", clickable = FALSE)) %>%
                addPolygons(data = results_area2, #choropleth 2 result polygons
                            fillColor = ~palette2(total),
                            fillOpacity = 0.5,
                            opacity = 1.0,
                            color = "Green",
                            weight = 1,
                            options = pathOptions(pane = "area2", clickable = FALSE))

My question is why does setting clickable = FALSE mean my mouse-over labels don't show up? Is there a way I can solve this or any alternative methods for getting unclickable mouse-over labels for my polygons?


texts: Change the precision of a .csv file attribute table

texts:
I have imported a .csv file containing unique identifiers with two decimal places (e.g. 53500001.00, 53500001.01 etc.). I am joining this file to a vector file with the same identifiers. However, when I import the .csv file the identifiers ending with .00 have been reduced to integers in the attribute table and the join returns null values in those instances.

It is census data so I can't go back through and manually change this as it's hundreds of thousands of lines. Is there a way to change the precision of the attribute table similar to in excel?


texts:
I'm testing spatial database performance on a dataset. Spatial objects in this dataset (stored as WKT in a flat text file) are random valid polygons which have vertex coordinates (x,y) where  100,000> x >0  and same for y.

Currently I'm having problem with inserting these data into PostGIS which has a geometry constraint check and I got an error like "violates check constraint "enforce_srid_polygon ".

So, how can I find/create a srid for my dataset ?

BTW: the polygons are valid polygons which are extracted from images by segmenting objects.


texts: Re-occuring errors in my JupyterLab environment because of instillation errors in anaconda?

texts:
I use python in the JupyterLab notebook environment through anaconda3 for my coding. I recently encountered a Runtime Error when trying to set the CRS for a geodataframe and from my research online it seems that this was due to an issue with the version of pyproj I had installed. Following another stack exchange online I ran the following in my anaconda prompt:

conda config --add channels conda-forge
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create -n geo geopandas
conda activate geo

However, now I am receiving a completely new error at the beginning of my code when I try to import plugins:

 ImportError: cannot import name 'pyproj_datadir' from 'pyproj.datadir'

At this point, it feels like I am creating more issues as I try to fix others so any advice on how to get everything working properly? Should I uninstall everything again and start over?


texts: How to add/remove Vector Layer from a Map

texts:
I have doubts about how to show or hide a vector layer on the map once I have created it. I generate it after doing a php query and receiving the data in json.
This is the function that I use to send the data to the query and once the json is received I paint it on the map:
function search(){
    var element = document.getElementById("formName");
    obje = document.getElementById('cbx_esp');
    var txt='';
    txt = "\""+obje.value+"\"";
    url_obje = 'abundance='+txt;
    drawAbundance(obje.value);
}
function drawAbundance(cbx_espId){
    var vectorAbundance = new ol.source.Vector({
        format: new  ol.format.GeoJSON(),
        loader: function(extent, resolution, projection) {
            var proj = projection.getCode();
            var url = "obAbundance.php"
            var xhr = new XMLHttpRequest();

            var params = {
                abundance: cbx_espId
            }

            xhr.open('POST', url);
            xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
            var onError = function() {
               vectorAbundance.removeLoadedExtent(extent);
            }
            xhr.onerror = onError;
            xhr.onload = function() {
                xhr.responseText;
                console.log(xhr.responseText);
                if (xhr.status == 200) {
                    vectorAbundance.addFeatures(
                        vectorAbundance.getFormat().readFeatures(xhr.responseText)
                    );
                    map.getView().fit(vectorAbundance.getExtent());
                    $("#formName")[0].reset();
               } else {
                 onError();
               }
             }
             xhr.send(JSON.stringify(params));
        },
    });
    var vectorlayer = new ol.layer.Vector({
        source:vectorAbundance,
        visible:true,
        displayInLayerSwitcher: false,
        style: distICES,
    });

    map.addLayer(vectorlayer)
}

//I tried this to show or not the veclayer
function add_de(e){
    if(e.checked){
        map.addLayer(vectorlayer);
    }else{
        map.removelayer(vectorlayer);
    }
}

I tried to create an input check and depending on whether it was checked or not, the vector layer was loaded, but it gives me the error that it is not defined:

Uncaught ReferenceError: vectorlayer is not defined


texts: Importing Python GPRas package returns ModuleNotFoundError

texts:
I am trying to use Benny Chins GPRas Package:

https://bitbucket.org/wcchin/gpras/src/master/

When I try to import the Package, I get:

...\GPRas\__init__.py", line 3, in <module>
from GPRa import GPRs, Data_Set, Output_Main
ModuleNotFoundError: No module named 'GPRa'

Has anybody used the package successfully and can tell me where I am going wrong?


texts: How to create polygons from a polyline graticule?

texts:
I'd like to make a polygon shapefile out of a polyline shapefile showing a graticule.

However, using the "Line to Polygon" tool results in a peculiar...something:

Other standard tools like "Buffer" etc. seem to work just fine with the polyline shapefile. Anyone experienced this before?

Edit:

I've just added another latitude to close the graticule and then used "Polygonize". It reached 50% and then crashed:

The log says:
"Uncaught error while executing algorithm
Traceback (most recent call last):
Traceback (most recent call last):
  File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 202, in execute
    self.processAlgorithm(progress)
  File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\algs\Polygonize.py", line 87, in processAlgorithm
    total = 50.0 / float(len(polygons))
ZeroDivisionError: float division by zero"

If there is something wrong with the original script, what can I do?

Edit 2:

Using "Polygonize" with the cleaned vector layer resulting from "v.clean" gives me the following as a result:

The "v.clean" error layer is completely blank. Which tool should I use in order to split the resulting lines from "v.clean" at each intersection with another line?


texts:
I've been using OSM2PO and it's a great system so far.

However, in version 4.5.2, I can't seem to ignore the one-way restrictions for calculating walk distances.

In the browser version, I check on "Ignore Restrictions" and "Ignore OneWays", but it makes no difference and still obeys the one ways, creating a longer/further walk time than is necessary.

I have tried various settings in the config file, such as these, but they don't seem to help:

graph.build.excludeWrongWays = true
graph.support.segments = true
graph.support.edgeflags = true
graph.support.reverse = false

Am I missing some kind of setting that disables oneways?  Could I have done something in the build phase which would have prevented this?

Thanks for your help!


texts: Esri Javascript API 4 Print Widget not printing graphics?

texts:
I am using the Esri Javascript API 4.3 api and have added a Print Widget to my webmap.

My map contains a few PictureMarkerSymbols that are displaying just fine on my map but when I export the map using the print widget, the symbols do not show up. I have tried replacing the PictureMarkerSymbol with a SimpleMakerSymbol and teh behavior is the same.

Can anyone help ?


texts: How to remove artifacts with SQL Server GEOMETRY::UnionAggregate()

texts:
We'd like to do an effective "real-time dissolve" on an Esri feature class with a SQL GEOMETRY shape where a parcel layer is "dissolved" into products using an attribute (ProductID) of the parcel layer.  The SQL Server UnionAggregate() function allows for this, using a query like this:

CREATE VIEW Product
AS
SELECT
 PPI.ProductID
 ,GEOMETRY::UnionAggregate(PL.SHAPE) as Shape
FROM ParcelProductInfo PPI
JOIN  ParcelLayer PL ON PPI.ParcelID = PL.ParcelID
GROUP BY  PPI.ProductID

This creates the desired result, but it has a side-effect where dangling artifacts are rendered in the Product layer where nodes in the parcel polygons may not have been exactly coincident, as shown here:

where the blue polygons are parcels and the orange polygons are the "dissolved" products.

Esri has a dissolve tool (arcpy.Dissolve_management())that seems to have an implied tolerance between polygon nodes since we don't see the same artifacts with that tool, but it's not a viable "real-time" solution.  However we're hoping to find something that performs a similar function in conjunction with GEOMETRY::UnionAggregate().

Any thoughts or ideas out there?


texts: Error while rendering Map from CARTO without any code change

texts:
I have suddenly started getting error while rendering US map.  This has come without any code changes.  We are using CARTO.js.

Uncaught TypeError: Cannot read property 'lat' of undefined
    at d.initialize (eval at module.exports (addScript.js?3fe7:27), <anonymous>:21:21536)
    at d.a.View (eval at module.exports (addScript.js?3fe7:27), <anonymous>:6:28431)
    at d.constructor (eval at module.exports (addScript.js?3fe7:27), <anonymous>:16:22865)
    at d [as constructor] (eval at module.exports (addScript.js?3fe7:27), <anonymous>:6:30704)
    at new d (eval at module.exports (addScript.js?3fe7:27), <anonymous>:6:30704)
    at Object.eval [as current] (eval at module.exports (addScript.js?3fe7:27), <anonymous>:23:13955)
    at window.vizjson (eval at module.exports (addScript.js?3fe7:27), <anonymous>:16:25517)
    at viz.json?callback=vizjson:1


texts:
I would like to produce a map of "points near a feature" in Tableau. For example, I would like to plot "rapid transit stops within 2 miles of the charles river".  I know how to do this using something like QGIS; I'm trying to figure out if this is even possible with Tableau.

The first step, ignoring the "near a feature" aspect, is simply to get the two sets of data to display on the same map at the same time, and I've been unable to make that happen. A major stumbling point for me is that Tableau appears to want to join all the data sources, but there is no clear join column in the absence of GIS functions like st_distance or something similar.

The examples I've seen so far (e.g., this one) for what Tableau calls "dual axis maps" seem to be either trivial (just a couple of rows of data) or to involve data that is tightly linked and has an obvious join column.

Am I chasing after the impossible here?


texts: Looking for GIS data for Curitiba, Brazil?

texts: I am wondering if anyone knows where to find building footprints, road network, transit, or environment feature data for Curitiba, Brazil.


texts:
I need to convert raster from one format to another (geotiff-->jpeg2000). First I tried with very simple workspace, having input geotiff and direct to output jpeg2000, but I got error message:
JPEG2000 writer: This format cannot support palettes. Consider removing or resolving palettes that are attached to the raster

What should I do?


texts: How to calculate Polyline length in kilometres without changing projection from WGS84 (using ArcObjects)?

texts:
I have Road (polyline) feature class and I wish to find those roads whose length are greater than 500 kilometre.

The feature class projection is in GCS_WGS_1984 and I do not want to change the projection.

Is there anyway to calculate length in kilometre through programming without changing projection?


texts: Geos projection not centered on the equator?

texts:
I'm working with QGIS and satellite view projections, in order to achieve something similar to the maps created by Richard Edes Harrison for Fortune magazine in the '40s (reference). I have a question regarding +proj=geos. I'm working with QGIS 3.8.2.

Is it possible to have a geos projection not centered on the Equator? Theese parameters (+proj=geos +h=30000000.0 +lon_0=70 +sweep=y) generates this map:

I would like to tilt the view towards the North Pole, so that Russia (outlined in red) would be more visible and centered on the view.


texts: ArcGIS for Server printing error " Unsupported 'type' in symbol: esriCLS.\nLayer "

texts:
If I have any polygon graphics in my graphics layer, my print task will not work. If I clear the graphics then it works.

{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool. Export Web Map Task Job ID: j7a98d1683c504a24a55024e9937412b5 : Layer \"map_graphics\": Unsupported 'type' in symbol: esriCLS.\nLayer \"map_graphics\": Unsupported 'type' in symbol: esriCLS.\nFailed to execute (Export Web Map).\nFailed to execute (Export Web Map Task)."]}}

The service will work if I add line or point  as graphic  to the graphics layer.


texts:
Extracting a bounding box from a FeatureCollection taking longer than expected. My layer has 86 multi-polygons:
var inun_raw = ee.FeatureCollection('users/sbryant/fred/GeoNB_LSJ_FloodExtent2018_0515b');
print('inun_raw feats = ' + inun_raw.size().getInfo())
var bbox = inun_raw.union().geometry().bounds(1000)

This takes many minutes to get a simple bounding box (the same operation in QGIS takes 0.03 secs).
What am I doing wrong here?


texts:
I am using the Java binding of GDAL to project a set of coordinate points from UTM to lat/log using the CoordinateTransformation Class of GDAL. I have written the code as follows:

SpatialReference oUTM = new SpatialReference();
SpatialReference oLatLog = new SpatialReference();

oUTM.SetProjCS("UTM 44/ WGS84");
oUTM.SetWellKnownGeogCS("WGS84");
oUTM.SetUTM(44, 1);

oLatLog = oUTM.CloneGeogCS();

double[] arr = new double[2];
arr[0]=10;
arr[1]=10;

double x = arr[0] , y = arr[1];

CoordinateTransformation transform = new CoordinateTransformation(oUTM,oLatLog);

transform.TransformPoint(arr);

System.out.println("Before:"+x+" "+y+"\nAfter:"+arr[0]+" "+arr[1]);

But when I run this in my main function, I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError:

org.gdal.osr.osrJNI.new_SpatialReference__SWIG_1()J
    at org.gdal.osr.osrJNI.new_SpatialReference__SWIG_1(Native Method)
    at org.gdal.osr.SpatialReference.<init>(SpatialReference.java:117)
    at controller.CrsConverterGDAL.main(CrsConverterGDAL.java:8)

Does anyone know how this can be fixed?


texts: Definition of OUTPUT parameter in PyQGIS 3 processing algorithms

texts:
In PyQGIS 2.X I could handle the output of processings algorithm as follows:

import processing
# None is the OUTPUT parameter here
buffer = processing.runalg('qgis:fixeddistancebuffer', network_from_nv_tmp, 0.1, 10, True, None)
clip = processing.runalg('qgis:clip', self.network_layer, buffer['OUTPUT'], None)

key approach here is to set the output parameter to None for running the algorithm and access it via result['OUTPUT'] in subsequent algorithms.

Now I try the same (or comparitivly the same) in PyQGIS 3:

import processing
buffer = processing.run('qgis:buffer', {'INPUT':network_from_nv_tmp, 'DISTANCE':0.1, 'SEGMENTS':10, 'END_CAP_STYLE':0, 'JOIN_STYLE':0, 'MITER_LIMIT':2, 'DISSOLVE':True, 'OUTPUT':None})
clip = processing.run('qgis:clip', {'INPUT':self.network_layer, 'OVERLAY':buffer['OUTPUT'], 'OUTPUT':None})

which throws the following traceback:

[...]
_core.QgsProcessingException: Unable to execute algorithm
Could not create destination layer for OUTPUT: invalid value

So my question is: What is a valid value for parameter OUTPUT here?


texts: What are the considerations for choosing between WKT and WKB geometries?

texts:
There are many questions &  answers here addressing how to convert between WKT and WKB geometries, and about the specifications or implementation details. But what are the considerations for choosing between them in general, when there are no external requirements? For example, is WKB faster?

Or for my specific use case: I want to convert a shapefile to SQLite in QGIS, and have to choose between WKT and WKB. When should I choose one over the other?


texts:
I have a .gpkg GeoPackage from here unzpped and stored on a cloud server. I want to make it possible to use as one of the URL based geo-services listed in QGIS (WMS, GeoNode etc) : So people can zoom in to their area of interest and selectively pull down just the data they need without having to download all 8 GBs of it. And it has to be in vector form with the metadata intact - can't be as raster tiles. What would be a good way of going about making such a deployment? I don't have prior experience in deploying geo-servers etc, sorry if this is sounding very naive.

Additional: I want to do this with docker and persistent volumes so that if there is any conversion/indexing to do, I can do it once and after that the whole thing can be shifted and redeployed anywhere else without having to repeat work.

Sharing bits and pieces I'm finding; would be great to cobble together a flow that starts with a .gpkg and ends with a QGIS-ready URL.

Import gpkg into PostGIS
Docker PostgreSQL Tutorial with Persistent Data (video)

Note for mods: this is not the same as a similar sounding question which is asking how to edit a .gpkg in the cloud. Another similar question about GML as the answers giving broken links.


texts: OTF Coordinate Transformation on QgsMapCanvas

texts:
I want to be able to reproject the current layer's CRS onto the map canvas' CRS. I am using the C++ library with Qt.
I have enable the OTF CRS transformation by calling

setCrsTransformEnabled(true);

I then set the Map Canvas's CRS using

mapCanvas->setDestinationCrs(selector->getSelectedCRS());

where selector lets you select the target CRS and mapCanvas is an instance of QgsMapCanvas.
However, once this is called, the current layer disappears. I have tried to reset the extents using setExtent() and refresh().

What am I missing?


texts: Kosovo ISO_N3 or ISO_A3 in Natural Earth

texts: How does one access Kosovo in the natural earth ne_10m_admin_subunits shapefile? It seems to lack the "XK" code needed to access it.


texts: Align spatial data that is to the left of a global dataset in QGIS, even though their CRS is the same

texts: I have downloaded a Version 2 CCMP Wind Product raster that is global in scale, and am trying to align it with a shapefile polygon of Canada and Greenland's administrative boundaries. Both datasets have the same CRS, and should line up just fine. However, because the CCMP raster depicts the world as a rectangle, it splits western Africa in half, with the majority of Africa on the left (west), and the rest of it on the right (east). As a result, Canada and Greenland appear to the west of the raster, where Canada and Greenland would be if the raster wasn't split in half at Africa. A screenshot of this is attached. How do I deal with this? I can't reproject the data because it's already in the same CRS. I am using QGIS 3.10.12, no access to commercial software


texts: Is it possible to figure out the projection used in a map?

texts:
I have the map below whose projection is unknown to me. It's a PNG image without metadata.

It comes from a webpage that shows radar information for France.
How can I figure out the projection it implements? I clarify that I don't require a perfect fit, something reasonably close would be fine, and I'm open to accept certain level of brute force. But I'd like to gather some ideas to make a sensible search.
It seems to be some sort of Lambert Conic, that's all I can tell 'by eye'. I have been using trial and error with QGIS, but the process of "define a projection -> set it -> try to fit the map as overlay -> discard it" is slow and I have little intuition to know which parameters to tweak and in which direction.
Ideas?


texts: Installing GPS device Explorist Magellan 210 (ca 2005) on Windows 8?

texts:
Windows is unable to reckognize my device. It's 10 years old but fully functionnal.
I would at least make it work as an external disk.


texts: Using Raster Calculator to generate a NDVI in QGIS

texts:
How can i access  raster calculator (to generate NDVI) in QGIS?

In case this is not a recommended method, is there any other way to generate NDVI in QGIS?


texts: adding WMS service to application ArcGIS JS api

texts: I've got map in projection: 4326 (WGS-84) when I try to add WMS layers which is in different projection I always get connection timeout Do you know if I could change WMS projection to set it up compatible with my projection? When I was using JAVA sdk I could connect WMS in different projections and arcgis server changed it projection ad hoc.


texts: How to get elevation data from XYZ source in Openlayers 3?

texts:
I have an XYZ file. For each pair of latitude and longitude values, there is an elevation value in meters in the file.

How do I get those elevation values in Openlayers 3?

Basically, my map will have an event. On every mouse click, the elevation value will show up based on the latitude and longitude.


texts: How can cities in a Metropolitan area share data collection costs?

texts:
Does anyone have any stories to tell (good or bad) about attempts to share the costs of data collection among cities/agencies in a metropolitan area?

Aerial imagery is a primary example, but would like to hear other experiences.

How can a small city justify funding a data collection effort when last year they paid for data that was made freely available?

If the data is not made freely available, is there some way to recover costs through data usage?


texts: How to best model GPS tracks for storage, visualization and analysis?

texts:
I am thinking about writing software to deal with GPS Tracks and Waypoints (mostly storing, displaying and calculating metrics such as speed, grade, and some simple statistics).

I wonder what should be the most conceptually robust data model regarding trackpoints, and here are some "candidates":

Considering Tracks as sequences of Trackpoints:

1.1. Tracks are considered "2D", since map projections are 2D. Trackpoints might or not have elevation, might or not have timestamp. Elevation and timestamp are consideres "extras", "optional". For terrestrial applications, elevation is a direct function of lat/lon (obtainable via DEM);

1.2. Tracks are considered "3D" since geographic space is, indeed 3D, and the trajectory of the receiver is 3D (2D projection is thus a form of data reduction). Timestamp might or not be present (the track could have been drawn by hand).

1.3. Tracks are considered "4D" (3 spatial + time). Thus, a hand-drawn map is a special case where elevation and timestamp are null or otherwise not present, but the Trackpoint properties are always "there".
Tracks are considered dictionaries of streams, where all the streams have equal lengths. There is a list of latitudes, a list of longitudes, a list of elevations, one of timestamps, etc. This makes easy to calculate statistics of each property, and the concept of Trackpoint becomes "virtual" in a sense, since it is a cross-section of many streams.

If I understood right, GPX format adopts 1.1., KML adopts 1.2. (with no support for timestamp), and Strava API adopts 2. (in JSON format), but in the end these are just FILE formats for serialization and storage, not necessarily for modeling, computational representation and numbercrunching.

Is there any form that is preferrable, in an object-oriented sense, and why? (I believe that strong typing and sensible modelling at least would avoid operations that doesn't make sense).

EDIT: some "intriguing" additional questions:

Is a hand-drawn track CONCEPTUALLY the same thing that a device-recorded tracklog? Should they be of different data types?
Should it be considered "correct" that KML stores null elevations as zero? Zero IS an elevation, and if you don't know the elevation you shouldn't assign a numeric zero to it, isn't it?
Should it matter, in a track with elevation, if the elevation is extracted from DEM data ("offline") or from GPS data or barometric data ("in the field")? Should this be flagged in the Track object? Saved to different Trackpoint properties? Ignored? Should they be different collection datatypes?
If I edit a device-recorded track in a map editor (adding, moving and removing points), or combine tracks from different dates, how should the timestamps in the trackpoints be handled? Should they be "resetted" to null? Should an object (trackpoint collection) of a different type be created from the former ones?


texts: QGIS variable cardinal buffering of points

texts: Is there a way of creating a buffer (elliptical I guess) in QGIS that has independent distances to the North, South, East & West (from the attribute table) so the buffer could be 5m wide to the North, 4m to the East, 6m to the South & 2m to the West? This is to show tree crown dimensions on a map.


texts: How to compute distances between points and polygon borders?

texts: I have point data and polygon in vector format. For each point, I want the distance from the point to the border of the polygon. However, if the point is inside the polygon, I want negative distance and if the point is outside the polygon, I want positive distance. Is there any way to do this in QGIS?


texts: Geowebcache-cache-result: MISS / request does not align to grid(s) 'EPSG:4326'

texts:
Any ideas on how to address this issue with the geowebcache?

< geowebcache-cache-result: MISS
< geowebcache-miss-reason: request does not align to grid(s) 'EPSG:4326'

I also tried other projections but the same output.

< geowebcache-cache-result: MISS
< geowebcache-miss-reason: request does not align to grid(s) 'EPSG:900913'

The tiles are generated in the appropriate directories so I assume path issues might not be the problem. Direct wms integration is enabled. The documentation mentions tiles size might be the issue but width and height is 256 and is consistent with the gridset dimensions. (http://docs.geoserver.org/stable/en/user/geowebcache/troubleshooting.html#direct-wms-integration)
as for the BBOX size, I am using the dimension derived from the GWC seed form.

Any ideas on how to approach this issue?

How can I make sure that the GeoServer is actually serving the cached data?


texts: Map not loading when using getLegend and showing error for getView()

texts:
I was able to run my application on using Legend earlier but now I want to update my Legend when scrolling on the map. So I tried to used this code GetLegendGraphic and getLegendUrl function filter by extent . And I got the gist of how he is able to do that but when I am trying the same I keeping getting the error
var graphicUrl = wmsSource.getLegendUrl(currentResolution);

I think this is mainly due to the wmsSource not declare. But I tried to initialize  seems wmsSource in TileWMS but does not seems to work.
var getExtent = function () {
    return map.getView().calculateExtent();
}
var getProjectionCode = function () {
    return map.getView().getProjection().getCode();
}

var updateLegend = function() {
    var currentResolution = map.getView().getResolution();
    var graphicUrl = wmsSource.getLegendUrl(currentResolution);

    const crs = `&CRS=${getProjectionCode()}`;
    const bbox = `&BBOX=${getExtent().join(',')}`;
    const height = getHeight(getExtent());
    const width = getWidth(getExtent());
    const heightAndWidth = `&srcwidth=${height}&srcheight=${width}` ;
    const legenOptions = "&legend_options=countMatched:true;fontAntiAliasing:true;hideEmptyRules:true;forceLabels:on" ;

    var img = document.getElementById('legend');
    img.src = `${graphicUrl}${crs}${bbox}${heightAndWidth}${legenOptions}`;
};
//Updated Legend End

//View
var myview = new ol.View({
    center : [8717490.201868,2788422.791843],
    zoom : 4
})

var firstSel = document.getElementById("City");
var secSel = document.getElementById("Sector");

//var LayerArray = [baseLayer, firstLayer]

//Map
var map = new ol.Map({
      target : 'mymap',
      view: myview,
      layers: [
        new ol.layer.Tile({
            source : new ol.source.OSM({
                attributions: 'Surveyor Allpication'
            })
        }),
        new ol.layer.Tile({
            source : new ol.source.TileWMS({
               url: 'http://localhost:8089/geoserver/India/wms',
               params: {'LAYERS': 'India:India', 'TILED': true,'TRANSPARENT':true},
               ratio: 1,
               serverType: 'geoserver',
               transition: 0,
            })
        })
      ]
})
updateLegend();

This here is my JS

        Legend:

This is my HTML.
How do I make this work?


texts:
Is TPKX a zip file archive of compact cache v2?
Yes uncompressed

Trying to find some specifications document
I have developed script to build Compact Cache v2 .bundle files from standard XYZ OR TMS raster  map tiles. Need to convert that folder structure to TPKX
I have some clients that want to use runtime apps as well as serve the raster tile cache with ArcGIS enterprise
https://www.reddit.com/r/gis/comments/cj5nny/can_you_convert_compact_cache_v2_to_tpkx_is_tpkx/?utm_medium=android_app&utm_source=share


texts: How to make labels appear in Geoserver? (WMS)

texts:
Possible Duplicate:
  How to avoid duplicate labels on each tile?

I have an Annotation Shapefile. I added it into GeoServer as point Shapefile and set its label with the help of the style parameter. But the problem is the labels don't appear at start up. The labels only appear after a lot of zooming in. Is there a solution for this? Like how labels appear in Arc Map?
Here is the sld.


texts: Expression for Modified Triangle Vegetation Index 2, Landsat 8

texts:
I am trying to run the index. In order to get it, I'm using raster calculator. Wrote the expression, but it's not coming rightly.
Could one check and revert whether the expression is right?
((1.8 * ("NIR" - "Green")) - (3.75 * ("Red" - "Green"))) / (SquareRoot((Square((2 *  "NIR") +  1)) -  ((6 * "NIR") - (5 * SquareRoot("Red")) - 0.5)))


texts: Displaying steep slopes with use of Contours in ArcGIS Desktop?

texts:
I am using Arc Map 10.1.  I have downloaded contour data as a shapefile.

Is there any way to use the contours to display steep slopes so 15%-25% or 25% and greater?


texts:
Is it possible to directly pipe data to ogr2ogr? I'm trying to curl a GeoJSON file and pipe it to ogr2ogr to covert it to another format.

Without using a pipe, I was able to achieve this by first writing a file and then converting it using the following command, but I'm curious if it is possible to skip that step.

curl "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson" -o "countries.geojson" && ogr2ogr -f "KML" countries.kml countries.geojson

I also tried creating a variable with the curl output instead of piping it, but ogr2ogr was not able to read it:

DATA=$(curl -s "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson") && ogr2ogr -f "KML" countries.kml $DATA


texts:
In QGIS 2.8, the heatmap plugin got CRS broken. I updated to 2.10, now in the plugin the dialog is broken: it does not let you choose the format.

I render layers for atlases with heatmap style. But I need to export it to GeoTIFF, and I don't see a way to do this.

Updating the QGIS is not easy in Ubuntu, since it works normally when installed from a PPA, but installing from sources, or downloading debs is  very painful.

Is there a workaround?

A command line example will do too.

edit here's a screenshot. The format list is empty, and if I write file extension manually as I did here, it still does not allow, showing a message that format is not chosen.

Meanwhile in another dialog, format choice works correctly:

Versions:


texts:
I've downloaded a kml file that contains only URL.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>World Heritage List</name>
<NetworkLink>
<name>World Heritage List</name>
<visibility>1</visibility>
<refreshVisibility>1</refreshVisibility>
<open>1</open>
<Url>
<href>http://whc.unesco.org/en/list/kmz</href>
</Url>
</NetworkLink>
</Document>
</kml>

Can I extract the points out of it into a SHP file, with preserving data table of them?

I only have QGIS and Google Earth (no pro version)


texts: Using findAndReplaceWorkspacePaths to change picture path element- ArcPy

texts:
Picture element, in 60 MXD files, disappear and there only blanked rectangle instead.

I know one way to solved it, by go to the picture properties-->picture tab.

But i try to find a way do it with arcpy. Is it possible?


texts:
I am looking to figure out how to auto-fill a custom form at the click of a button. Basically i have a toolbar where if I click the button and a point on the map a form pops up and gives me a bunch of options. To make it easier I am looking to have a few pre-made forms so if i click on lets say a corn icon on the toolbar and then click on the map, The form would pop up with all the corn details already filled on the form so you just need to hit OK  and it places the point.
As an example this is how the form looks when clicked. I need it to be filled out so when I click on my black bean button it comes out filled as
LandUse = Agr. - Pulses and
Crop Type = Beans - Black Beans

The repeat attributes toolbar will not work because it does not save the Crop Type but only the LandUse.


texts: Getting coordinates for locations from Google Map?

texts: I wonder is it possible to get coordinates (of pins) from Google Map which is integrated in some website?


texts: How to get the coordinates inside the polygon using python

texts:
I have a polygon and using this code snippet we can get the coordinates boundary of the polygon.

canvas = qgis.utils.iface.mapCanvas()
aLayer = canvas.currentLayer()
coord = feat.geometry().asPoygon()

So if i want to get the coordinates inside the polygon also how can i do that using python?


texts: Error : routed due to violated constraints

texts:
We've been working with the Network Analyst to perform a VRP (vehicle routing problem).  We have been modifying and adding to the VRP. But the network gives an error and the routing is not done.
Network image in ArcMap  was attached


texts:
I am looking for ways to make .lyr files usable in QGIS. It appears that they can be converted into an .sld file in ArcMap but according to one of the posts, they only store symbology and do not point to the data itself. Do you know of a way to make the .lyr files into their equivalent (.qml?) in QGIS? These are the sources I have reviewed:
Adding Layerfiles (.lyr) to QGIS?

Converting ArcGIS layer style to Styled Layer Descriptor (SLD) file?

Can QGIS automatically load an SLD with a Shapefile?

Does QGIS have the equivalent of ArcGIS's Layer (*.LYR) file?


texts: How to activate GRASS 7 v2 in QGIS 2.18 on Mac

texts:
I have QGIS installed. I've ticked GRASS 7 in Plugins/Manage and Install plugins, but the Grass Tools options are all greyed out with No mapset is open reported.  In the GRASS options the New Mapset is also greyed out.

Couple of other questions on this relating to Windows.  Nothing obvious for Mac.


texts: Formula for Enhanced Vegetation Index (EVI) in ERDAS modelbuilder?

texts:
I am trying to derive Enhanced Vegetation Index (EVI) from Landsat 5 TM data  using ERDAS model builder.d I can't seem to get the output I want as it comes out blank.

This is the formula that I used:

2.5 * (("%Band 4%" - "%Band 3%") / ("%Band 4%" + 6 * "%Band 3%" - 7.5 *"%Band 1%" + 1))

can someone assist me with the exact formula I need to type into ERDAS model builder?

Does anyone see something in here that doesn't make sense -- or even better -- a formula I could copy/paste?


texts: Using arcpy.mapping.ListLayers() with no filter, but some layers are missing in list

texts:
I am trying to use arcpy.mapping.ListLayers() to access and change some of the properties on specific layers in my mxd prior to printing to PDF.  Here is a screen cap of my layer list:

When troubleshooting, I noticed that 4 of the layers (the ones I've highlighted) are not appearing in the resulting list provided by arcpy.mapping.ListLayers().  The layers that are missing are stored in a local gdb; the ones that come through in the list above are stored in SDE.

Here is a snippet of my code:

mxdpath = os.path.join (sys.path[0],"SectionIDMaps_cover.mxd")
map = arcpy.mapping.MapDocument(mxdpath)
dataFrame = arcpy.mapping.ListDataFrames(map)[0]

layers = arcpy.mapping.ListLayers(map,"",dataFrame)

print result of layers:

[<map layer u'Recently Closed (past 24 Hours)'>,
<map layer u'Wards (2012)'>, <map layer u'ANC (2012)'>,
<map layer u'DC Streets'>, <map layer u'DCGIS.streets'>,
<map layer u'DC Boundary'>, <map layer u'Buildings'>,
<map layer u'Water'>, <map layer u'Parks'>,
<map layer u'DCGIS.ParkPly_Gen'>, <map layer u'DCGIS.DCBndyPly_Gen'>]

Any ideas?


texts: ArcGIS API JavaScript, Flex, and Silverlight updated comparision

texts: Does anyone know of a site, blog, etc. that constantly updates a comparison between the various ArcGIS APIs for each new release of the API?


texts: Combining custom QWidgets with ui file generated from QGIS plugin builder?

texts:
I am having a hard time figuring out how I can include several QWidgets (created in individual scripts) into the QT Designer ui file generated from a QGIS plugin builder. These are custom widgets I would like to include in the ui file because , however, I realize I have to use the ui file from Qt designer to make it connect with the map canvas in qgis. When I generate the widgets over the ui file, one gui overlaps the other.

How do I get the QWidgets into my script instead of on top of my script to where they will be included in the ui file?

I have looked at many tutorials and I can't seem to find any with this problem.

The dialog.py file is included below where it shows how all the widgets are incorporated with the ui file:

 from PyQt4 import QtGui, uic
 from PyQt4.QtGui import *
 from PyQt4.QtCore import *

 import numpy
 import re
 import sys

 from ui_eggcode import Ui_BoxCodeDialogBase

 #Individual QWidgets to import
 import ConcSpin, ConcSpin_Ct, ProxyWidget, PoshLabel, StageSpin,     FormSpin
 import IceBox, BoxCodeWidget, PresetsWidget, BoxDiagram

 FORM_CLASS, _ = uic.loadUiType(os.path.join(
os.path.dirname(__file__), 'egg_code_dialog_base.ui'))

 class BoxCodeDialogDialog(QtGui.QDialog, FORM_CLASS):
    def __init__(self, parent = none):
    """Constructor."""
    #super(BoxCodeDialogDialog, self).__init__(parent)

    # The following line is just the default for a dialog box,
    # comes in from QGIS plugin designer. Do not use.
    # QtGui.QDialog.__init__(self)

    self.eggvals = IceBox.IceBox()

    eggdiagram = BoxDiagram.BoxDiagram(self.eggvals)

    tabWidget = QTabWidget()
    tabWidget.setMinimumSize(QSize(370.0, 332.0))

    presetWidget = PresetsWidget.PresetsWidget(self.eggvals,eggdiagram,parent=tabWidget)
    tabWidget.addTab(presetWidget, "&Presets")
    eggWidget = BoxCodeWidget.BoxCodeWidget(self.eggvals,eggdiagram,parent=tabWidget)
    tabWidget.addTab(eggWidget, "&Box Code")

    buttonBox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)
    self.connect(buttonBox, SIGNAL("accepted()"), self, SLOT("accept()"))
    self.connect(buttonBox, SIGNAL("rejected()"), self, SLOT("reject()"))
    self.setWindowTitle("Set Number Format (Modal)")

    #The following activates the ui file in QT Designer
    # Sets dialog layout correctly
    layout =QVBoxLayout()
    layout.setSizeConstraint(QLayout.SetFixedSize)
    layout.addWidget(eggdiagram)
    layout.addWidget(tabWidget)
    layout.addWidget(buttonBox)

    #The following activates the ui file in QT Designer
    self.setLayout(layout)
    self.setWindowTitle("Box Code")

    # Set up the user interface from Designer.
    # After setupUI you can access any designer object by doing
    # self.<objectname>, and you can use autoconnect slots - see
    # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
    # #widgets-and-dialogs-with-auto-connect
    # Don't use the following, use Ui_BoxCodeDialogBase()from the original
    self.setupUi(self)
    self.ui = Ui_BoxCodeDialogBase()
    # Sets dialog layout correctly

    #attribute for storing position of the dialog
    self.userPos = None


texts: Techniques for offline reverse geocoding on a mobile device?

texts:
I am working on a mobile mapping application (currently iOS, eventually Android) - and I am struggling with how to best support reverse geocoding from lat/long to Country/State without using an online service.

Apple's reverse GeoCoding API depends on Google as the backend, and works great while connected.  I could achieve similar functionality using the Open Street Maps project too.

What I really want however is to create a C library that I can call even when offline from within my application, passing in the GPS coordinates, and having it return the country and/or state at those coordinates.

I've seen examples of how to do this on a server, but never anything appropriate for a mobile device.

What are some techniques to accomplish this?


texts: How to build SQL query in arcpy using script variable?

texts:
I am trying to build a simple query where a feature layer field needs to be smaller than a certain number and another feature layer field needs to be bigger than a variable previously created in the script.

I know the following query (comparing a feature layer field with 2 strings) works fine.

> query = "ESTATE LIKE '{0}' OR ESTATE LIKE '{1}'".format('Node Live%','Node%Planned%')

So, I thought the following line would be correct:

> query = "gridcode < '{0}' AND Shape_Area > '{1}'".format(2,thres_area)

But it seems it isn't

NOTE: 'gridcode' and 'Shape_Area' are two feature layer fields and 'thres_area' is a script variable (integer) previously created.

Any idea what would the correct sintaxis be like?


texts: Transforming projected coordinate system using QGIS?

texts:
I have two raster datasets, they have different projected coordinate systems; one in WGS_84_UTM_Zone_N34, another in Hungarian_1972_EOV,  they overlap each other perfectly if I open them in QGIS.

I would like to transform the coordinate system of the first raster into the second.

I tried Project Raster tool in Data Management toolbox (ArcGIS), it converted the first raster into Hungarian_1972_EOV, but it doesn't overlap with the second raster perfectly (There is a shift between two raster datasets fo about 10-15 meters).

Can anybody help me to find out what is the problem?


texts:
Is there an easy way to "inspect" the nodes that make up a line?

I am interested to see what node is the 1st, 2nd and so on along with their coordinates. Preferably in a list or something for a selected feature that is not in edit mode.
I know I can add a marker to display the direction a line is digitilized at, but I am looking for the individual nodes.

I use another GIS program too that can do it very nicely (Intergraph), looking for a similar tool/method for QGIS.


texts: Make markers iteractive to show infowindow on click

texts:
I've used in my html file:

var layerSource = {
            user_name: 'username',
            type: 'cartodb',
            sublayers: [{
                sql: "SELECT * FROM post",
                cartocss: '#post {marker-fill: red;}',interactivity: "cod",
           }]
}

And it displays all my markers.
Now I need to display windows about each marker within their field when on an onclick event. But the markers aren't interactive and so I can't display the windows.


texts:
On a vector layer, I selected some points to make a polyline, and, let a Vertex Marker move along the polyline.

Now, I want to moving the marker smoothly between two points (means I need calculate points between two selected points), and, the marker's moving speed can be special, e.g: 5 km/h.

Is there any way to make these functions?


texts: Pulling CSV file directly from website into QGIS?

texts:
I want to be able to automatically update my csv files in a QGIS project. My organization has an online database that can easily export csv files.

These csv files are constantly updated with new information. I want to be able to link my QGIS project layers directly to the updated csv files so I do not have to constantly be uploading and rejoining layers to have current maps.

Is there an easy way to link the csv file? I am fairly new to QGIS.


texts: Allowing for multiple lines in legend of ArcGIS Desktop?

texts:
How can I force the description text in my legend to occupy more than one line?

This is basically the same question as Forcing long layer names to multiple lines based on specified legend width in ArcGIS Desktop?.

However, I want to use Categories/Unique values and not Features as my Symbology style, in which case there's no Description button. Even when I change to Features, it seems I can't use multiple lines (I suppose that there's been some changes to this functionality).

How would I go about getting the description/header text across multiple lines?


texts: Zonal statistics discrepancy between ArcGIS Desktop versions?

texts:
I've discovered a weird phenomenon using zonal statistics with a colleague at another office. We are attempting to use the Zonal Statistics as Table tool to sum the value of raster cells within polygon zones. We are using two zone  polygon files: one with about 12 "discrete" zone polygons, and the other with a single "broad" zone polygon.

The odd result is this: While we get the same results running the raster and discrete zones polygon file, we get different results when running the raster and broad zone polygon file - by an order of  magnitude (for example, where one result is about 50 million for me, his is about 5 million).

We are using the same raster, and the vector files have been projected to match the raster projected coordinate system exactly - to avoid issues from projecting on the fly. The only difference we can find between our protocols is that he is on ArcGis 10.1 and I am on Arc 10.2.1. As far as I know we both have all licenses.

From @Whuber's detailed explanation at Does Zonal Statistics value change when applied on subset of data using ArcGIS Spatal Analyst?, I think it has something to do with changes in the "black box" of zonal statistics calculations.


texts:
I'm using OpenLayers 2.13, GeoServer 2.3.5 for development.

I have a GeoWebCache layer as base layer and one vector layer for showing route (please check the attached image).

If I drag or zoom in to any part of that route layer map tile is hiding rest of the vector layer part.

Please guide me to show all my vector layer in all zoom level.


texts: What is the difference between data access's "SHAPE@XY" and "SHAPE@TRUECENTROID" tokens?

texts:
Data Access Search Cursor.

What, if anything, is the difference between the tokens "SHAPE@XY" and "SHAPE@TRUECENTROID"?

They returned the same coordnates on a test polygon:

>>> cursor = arcpy.da.SearchCursor("test", "SHAPE@XY")
>>> for row in cursor:
...     print row[0]
...
(559389.3838043335, 4239093.201390337)

>>> cursor = arcpy.da.SearchCursor("test", "SHAPE@TRUECENTROID")
>>> for row in cursor:
...     print row[0]
...
(559389.3838043335, 4239093.201390337)

It behaved the same way for a multipart polygon feature. Does it ever return different results?


texts: openlayers cluster strategy - exhibiting custom icons for clusters of 1 feature

texts:
i have a page that displays a vector layer imported from a kml file (basically like the the sundials example).  it works perfectly well, both using fixed strategy ONLY, as well as using both fixed and CLUSTER strategies simultaneously.

i would like to create a hybrid display, whereas "clusters of 1 feature" would be displayed with the original custom icon contained in the KML file under <Style><IconStyle><Icon><href>img/arrowRed.png, for example.

right now, if i use cluster strategy, clusters of 1 (feature) are displayed using the default icon (yellow disk).

i would rather not use any plugins or libraries that aren't standard openlayers.   any suggestions?

below a part of the original javascript code using clusters (remove the cluster strategy declaration new OpenLayers.Strategy.Cluster() and custom icons are displayed just fine):

var urlKMLClient = 'KMLClientsAll.kml';
var layerKMLClient = new OpenLayers.Layer.Vector("Clients", {
        strategies: [new OpenLayers.Strategy.Fixed(), new OpenLayers.Strategy.Cluster(), refresh],
        protocol: new OpenLayers.Protocol.HTTP({
            url: urlKMLClient,
            format: new OpenLayers.Format.KML({
                extractStyles: true,
                extractAttributes: true,
                maxDepth: 2
            })
        })
    });

see Client custom icon (green marker) gives way to cluster default icon (yellow disk) below


texts: Creating drop down box / combo box of bookmarks from ArcGIS Online webmap?

texts:
Without using the clunky ArcGIS bookmark dijit, how do I create a drop down box of bookmarks from an ArcGIS Online webmap (or JSON) that zoom to the extents when clicked?

//FYI, JSON format
"bookmarks": [
    {
      "extent": {
        "spatialReference": {"wkid": 102100},
        "xmax": -1.2251063434141435E7,
        "xmin": -1.2561092020865962E7,
        "ymax": 4977986.7113767695,
        "ymin": 4811659.737828305
      },
      "name": "Utah County"
    },
    {
      "extent": {
        "spatialReference": {"wkid": 102100},
        "xmax": -1.2615515185004937E7,
        "xmin": -1.3235572358454255E7,
        "ymax": 4310538.580390846,
        "ymin": 3977884.633293776
      },
      "name": "San Bernardino County"
    }
]


texts: How to make distance to roads raster from a landsat image?

texts: I want to make a land change cover model to predict deforestation in QGis and I already did two maps of land classification using landsat images from 2017 and 2013 but to continue with my model I need a distance to roads map or a population density raster, but I dont know how to get that information from my landsat images, is that even possible?


texts:
I tried adding an SVG as a layer on my map but it does not show up.

//For registering EPSG: 2326
import * as proj4x from 'proj4';
var proj4 = (proj4x as any).default;
import {register} from 'ol/proj/proj4';
proj4.defs('EPSG:2326', '+proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m +no_defs');
register(proj4);
var projection2326 = get('EPSG:2326');
  var extentTest = [815366.7950903749, 818259.401599934, 815684.9262746248,825970.8994440462 ];

  var projectionTest = new Projection({
    code: 'EPSG:2326',
    units: 'm',
    extent: this.map.getView().calculateExtent(this.map.getSize())
  });

  var SVGLayer = new ImageLayer({
    source: new Static({
    url: 'assets/SvgFile.svg',
    projection: projectionTest,
    imageExtent: extentTest
    })
  });
  this.map.addLayer(SVGLayer);

Am i writing the extent wrong ? The drawing does not show up on the map at all.


texts: Is it possible to set the default font in ArcMap 10.4.1 to Times New Roman?


texts: Bringing symbology into ArcGIS Pro from ArcMap is bringing data with it?

texts: I have tried bringing in symbology from ArcMap to ArcGIS Pro, but when I did this, the data within the ArcMap document came along with it..I just want to bring symbology only! Otherwise I will need to create symbology that took quite a long time to create. Is it possible to JUST bring the symbology?


texts: Running python script from editor and through toolbox work differently

texts:
## Import required tools...
import arcpy
arcpy.env.overwriteOutput = True

## Set workspace environment
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
arcpy.env.workspace = "E:\Dropbox\GIS\MAS-GIS\GIS 601-602\gisclass\mgisdata\Labs\Python\PythonPractical.gdb"

## Define starting layers
layer1 = "Oregon_Boundries"
layer2 = "Parks"
layer3 = "Highways"
layer4 = "Park_Fires"

## Draw layers to ArcMap
dataSetLayers = [layer1, layer2, layer3, layer4]

for x in dataSetLayers:
    updateLyr = arcpy.mapping.Layer(x)
    arcpy.mapping.AddLayer(df, updateLyr, "TOP")

## Process: Intersect Parks and Fires
inFeatures = ["Parks", "Park_Fires"]
intersectOutput = "Park_Fires_Intersect"
arcpy.Intersect_analysis(inFeatures, intersectOutput)

layerList = arcpy.mapping.ListLayers(mxd)

arcpy.Delete_management(layer4)

When I paste into the python window in Arcmap, it adds the 4 layers to the map, does an Intersect on two of them, then removes a layer. Works great. When I use this same script from a toolbox where I "Added Script", it skips adding the 4th layer and doesn't do an Intersect at all. I'm not sure why the difference.

I'd like to mention I'm new to ArcMap, GIS, and Python. I just started school for GIS.


texts: How to dynamically change SLD style of WMS layer being served by GeoServer from PostGIS?

texts: How can I dynamically change a SLD style of a WMS layer being served by GeoServer from PostGIS?


texts: Extract the value of each pixel within polygon

texts: I have a vector layer defining a region. I have then loaded a DEM and made an aspect layer. How can i export the value of each pixel within the vector layer? I need to manipulate them in Excel


texts:
So, if I implement the esri GeoServices REST API with a non-esri service, what clients can I use with it?

We (GeoREST) were initially thinking that ArcGIS Explorer or other desktop clients would be able to access it, but this doesn't seem to be the case.  Looking at the web stream with Fiddler, these appear to fall back to a SOAP interface when passed the REST end point.

The web APIs looked promising, but the terms under which you're allowed to use them appear to be pretty restrictive:

http://www.esri.com/software/arcgis/web-mapping/pricing.html
http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_termsofuse.htm

I thought these permitted use for public, non-commercial purposes, but wording in the second link made me doubt that interpretation.

I may be missing something, but a lack of freely usable clients seems to limit the value for a third party to implement this API.

Does anyone have any further insight into the licencing restrictions on the web APIs, or know of other services that grok the REST API?


texts: Why am I unable to download Landsat 8 geotiff data from the USGS site?

texts:
I seem to have an issue with not being able to download geotiff Landsat 8 data from te USGS site.  After i find the image i would like to download and proceed to download the Level 1 geotiff option is disabled and I am only allowed to download the LandsatLook jpeg images.

I downloaded data from this site before but perhaps I am overlooking something.

I tried both http://glovis.usgs.gov/ and http://earthexplorer.usgs.gov/

Screen capture showing the disabled "dimmed" option:


texts: Difference between spatial and geometric resolution

texts:
Wikipedia quotes Campbell 2002 as saying:

Spatial resolution is defined as the pixel size of an image representing the size of the surface area (i.e. m2) being measured on the ground, determined by the sensors' instantaneous field of view (IFOV)
Geometric resolution refers to the satellite sensor's ability to effectively image a portion of the Earth's surface in a single pixel and is typically expressed in terms of Ground sample distance, or GSD. GSD is a term containing the overall optical and systemic noise sources and is useful for comparing how well one sensor can "see" an object on the ground within a single pixel. For example, the GSD of Landsat is ~30m, which means the smallest unit that maps to a single pixel within an image is ~30m x 30m. The latest commercial satellite (GeoEye 1) has a GSD of 0.41 m (effectively 0.5 m due to United States Government restrictions on civilian imaging). This compares to a 0.3 m resolution obtained by some early military film based Reconnaissance satellite such as Corona.

I'm confused by what the difference is between spatial and geometric resolution.

Is geometric resolution where a satellite image is said to resolve to 50cm, meaning that's the area on the ground that is sampled into a given pixel... And is spatial resolution defined along the lines of 1000x2000 pixels / square mile?  Wikipedia's mention of "(i.e. m2)" makes me think the spatial resolution is defined in a square measurement of ground area, which is the same unit as geometric resolution, which gives me my confusion.  Or would it just be said as a 1000x2000 pixel image, with no reference to ground size?


texts: ogrmerge cannot open input files specified as a pattern

texts:
I have several geojson files which I am trying to merge using the ogrmerge.py script. For some reason I am getting ERROR: Cannot open *.geojson when I run
ogrmerge.py -o merged.geojson *.geojson -f GeoJSON -single

The operation works perfectly when I execute
ogrmerge.py -o merged.geojson f1.geojson f2.geojson -f GeoJSON -single

Any ideas why the * pattern matching is not working?
I am on Win7 and using Python27 bundled with my OSGeo4W install.


texts: gdal_translate problem translating 16bit PNGs

texts:
I am trying to use the SRTM earth images to convert them into heightmaps for 3D application.

I can output a 8-bit PNG like this:

gdal_translate -ot Byte -scale -of PNG srtm_44_05.tif heightmap.png

Opening Photoshop/Paint.net confirms it's legit. However I want the extra precision of 16-bits...

If I try to output a 16-bit PNG however like this:

gdal_translate -ot Uint16 -scale -of PNG srtm_44_05.tif heightmap.png

It's just a black image when viewed in above applications. I am suspecting it has something to do with the byte ordering being wrong...?

For example if I output a RAW image like this

gdal_translate -ot Uint16 -scale -of ENVI srtm_44_05.tif heightmap.raw

And then open it in Photoshop and have it interpret it as 16-bit with one channel in MAC byte ordering then it looks fine. If I specify PC byte ordering it's just like the PNG (black image).

I have found a tedious workaround by using gal_translate to produce 16-bit RAW and then open it with Photoshop and export it as 16-bit PNG. That works but it shouldnt be necessary.

Is the byte ordering the problem? What can I do to produce legit 16-bit PNG images?


texts: location of a dragged and dropped marker using leaflet

texts:
I am using the leaflet API with OSM. I need to implement a functionality where on dragging the marker and dropping it on user preferred location, I need to get its latitude and longitude and save its location to database.

For now on double clicking the marker I am able to drag the marker. This line helped me:

draggable:true

Now when I release the marker I want to find the latitude and longitude of the location or invoking a function on dragging the marker, returning the lat,lng values.


texts: I have a floodplain layer with elevations assigned to it. Per scope of the project, I need to create a safety setback. The flood elevation is raised by 2 ft. and when the raised point extended horizontally to the ground becomes the setback. How do I create this setback/buffer?


texts: Unable to Add Features to PostGIS Layer in Quantum GIS 2

texts:
I am testing out Quantum GIS 1.9-master and I've noticed that I am only able to add features to a PostGIS 2.0 layer if that layer is in a schema with the same name as my login. For example, if my login names is "brett", I am able to add features to the table brett.test_table, but not fred.test_table (regardless of the table permissions (I do have INSERT, UPDATE, DELETE permissions on tables in both schemas). Strangely enough, I am able to perform updates to features in tables in other schemas (i.e. I can move or reshape a feature).

I am able to add features fine to tables in other layers using Quantum GIS 1.8 (so I don't think it's a PostgreSQL permissions issue).

Has anyone else experienced a similar issue? I'm wondering if this is a bug, or a new way of handling editing in Quantum GIS 1.9.


texts: Adding Selected Features Checkbox to ArcGIS Python Script Tool?

texts:
How do I add a checkbox that allows the user to only apply tool to selected features?

#CalculateMultipleFields.py
#Created By: Neal Banerjee
#Date: Novemeber 2013
#Purpose: Calculates multiple fields to a user defined value

#Import modules
import arcgisscripting

#Create the geoprocessor object
gp = arcgisscripting.create(9.3)

#Get Input Fields as User Argument
inFC = gp.GetParameterAsText(0)
inExp = gp.GetParameterAsText(1)
inFldsLst = gp.GetParameterAsText(2)
inFlds = inFldsLst.split(";")

#Iterate through fields and calculate value
for field in inFlds:
  gp.CalculateField_management(inFC, field, inExp)

I am using ArcGIS Desktop 10.4.1.


texts: rasterio read from HDFS - rasterio.errors.RasterioIOError: No such file or directory

texts:
I am trying to read TIF files from HDFS with rasterio but I keep getting this error:

>>> image_uri="hdfs:///user/hadoop/<>.tif"
>>> import rasterio
>>> rasterio.open(image_uri)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/anaconda2/lib/python2.7/site-packages/rasterio/__init__.py", line 193, in open
    s.start()
  File "rasterio/_base.pyx", line 76, in rasterio._base.DatasetReader.start (rasterio/_base.c:2969)
rasterio.errors.RasterioIOError: No such file or directory

I can't find any reference to what filesystems rasterio supports, does it only support reading from a local filesystem? Does it not support HDFS?


texts: Save WFS (~100000 features) as geopackage with QGIS

texts: I am trying to load a WFS (address:     https://fbinter.stadt-berlin.de/fb/wfs/data/senstadt/s_fb_berlinbtk) into QGIS 3.4 in order to save it as a geopackage. I can connect to the WFS but adding it to my session keeps producing a timeout error message after some of the features have loaded. Other WFS with less features have not caused the same problem. Is there any (possibly quick) way to save a WFS with many features as a geopackage or shapefile?


texts: Mapping between OGR and Python data types?

texts:
I'm writing a shapefile using OGR in python, creating fields on-the-fly from a python data source. Creation of a new field requires an OGR data type, is there a mapping between OGR and python data types?

For example, this would be the norm:

new_field = ogr.FieldDefn('MYFLD', ogr.OFTInteger)

Ideally:

ogr_datatype = get_ogr_data_type(python_data)
new_field = ogr.FieldDefn('MYFLD', ogr_datatype)

Currently my conversions are hard coded (e.g. int = ogr.OFTInteger), but this is a bit of a pain and relies on me coding all possible data types.


texts: How can I suspend default shortcut menu and substitute with a custom menu in the TOC?

texts:
I looking for solution (using ArcObject SDK 10.1 (VB.NET) ArcMap Addin template) to substitute the default shortcut "right-click" menu in the TOC (When a TOC Item is right-clicked) with a custom menu when a custom tool is active.  (I would like default functionality when a custom tool is inactive)

I already do that in the map - I have a custom tool and when the tool I show a custom menu on right-click.  The custom behavior only works within the map frame.

How can I do the same in the TOC?


texts: Clipping area from big raster without Resampling

texts:
I'm trying to polygonize a raster.
The raster is a very big raster so I try to clip it with gdalwrap and a polygon in a shp file as mask.

After cliping (and polygonize it) I see that the pixel are moved and in some cases the value is changed (following resampling_method parameter).

What I want is that the pixels are in the same place that the original one, without offset and without re sampling, im not worry about the final raster had more (not less) area that mask polygon.

The trasparent area is the mask (the area were I want to work).
The first image is the poligonized result without cliping.
The second one is cliped in a bigger poligon (pixel still moved and modified).
The third one is cliped to the interes area with this command: gdalwarp --config GDALWARP_IGNORE_BAD_CUTLINE YES -r max -q -crop_to_cutline -cutline  $3   -of GTiff raster.TIF maskFile

With a bigger mask area

If you take a close look to the square you will see that the pixels are moved, and values changed because pixels with the same value are joined.

What I want is something like second image but with the pixels origins and values equals to original raster. (Not worried if I have to do in code or command line or wherever)


texts: Importing KML filename as attribute using FME?

texts:
I have over 5,000 KML files where its name (*.kml) is crucial for my analysis: it contains the ID of that feature. I want to use the filename to populate a new field, or replace the existing content of the 'Name' or 'Description' fields.

I'm a geographer, so my programmer/command line skills are extremely low, although I don't think I'll get it done without it.

Any ideas?


texts: Problem Initializing License for ArcEngine application

texts:
I have written an ArcEngine application using vb.net and Visual Studio 2010.  When I initially started the code, I indicated an ArcInfo license was available during the project setup.  This worked fine for a while, and then one day for no apparent reason it stopped...but at the time I didn't need ArcInfo, I just needed ArcView, so I changed the LicenseInitializer to use ArcView and it kept on working, so I didn't give it any thought.  (How I wish I'd written down what might have changed!)

Now I do need ArcInfo for what I'm trying to do, and I've tried changing the requested license back using the Project->Add ArcGIS License Checking tool just in case I accidentally messed something up, but it won't work.

What is particularly confusing is that the error message I'm getting says ArcInfo isn't initialized, but then if you scroll down, it says it is (see image).  Note that I'm not trying to use any of the extensions, just ArcInfo itself.

I've stepped through the code, and the InitializeApplication function on the Startup handler (code below) returns true.  The error occurs when my form with an embedded AxMapControl actually attempts to use the license (BeginInit method on AxMapControl).

Private Sub MyApplication_Startup(sender As Object, e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
    'ESRI License Initializer generated code.
    m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeArcInfo}, _
    New esriLicenseExtensionCode() {})
End Sub

I know that I have an ArcInfo license on this computer, and now that I've regenerated the license for my code with the License Checking Tool I'm confident I haven't messed with any normally hidden files I shouldn't be touching.  Any ideas as to what might be causing this error??


texts: GDAL - Unable to convert to Web Mercator using gdalwarp

texts:
I am making geoTIFs of weather data (for a Mapbox overlay) and I am converting them to web mercator for use on the map. The images were generated from the same source file and both images have the same coordinates (files provided below). The first file below converts to Web Mercator perfectly and shows up in Mapbox exactly where it should be. The second file (according to the gdalinfo dump) converted to Web Mercator also - but the coordinates changed! Why is this and how do I fix it? The second file does not display properly on the map because of this.

Below are links to both geoTIF files and my script I used to convert.

KEWX_L2_REF.TIF -  1st original geoTIF file, it converts just fine

KEWX_L2_VEL.TIF This is the 2nd original geoTIF file, the one that won't convert without distorting coordinates

Here are the GDALINFO dumps :

KEWX_L2_REF.tif - Original
KEWX_L2_REF-projected.tif Projected (coordinates are good after conversion)

KEWX_L2_VEL.tif - Original
KEWX_L2_VEL-projected.tif - Projected (coordinates have changed for some reason, should match the REF file above

The scripts I am using for these are the following :

gdalwarp EPSG:3857 KEWX_L2_REF.tif KEWX_L2_REF-projected.tif

and

gdalwarp EPSG:3857 KEWX_L2_VEL.tif KEWX_L2_VEL-projected.tif

The original coordinates are identical and the scripts are identical (except for the filename of course) but I am trying not to rule anything out.

Is this something simple in the script that I should understand, what am I missing?


texts:
I want to execute GeoServer WPS process asynchronously.
Is it necessary to change anything inside a synchronous process or to customize specific parameters at execution? I've tried to add mode="async" into wps request parameters, but geoserver wrote:

  Attribute 'mode' is not allowed to appear in element 'wps:Execute'.

Is there any examples of the asynchronous process realisation?


texts: How to monitor how many people are using the GeoServer simultaneously?

texts: I would like to know if there is any way to monitor how many simultaneous accesses to the GeoServer. How can I do this?


texts: PyQGIS: What objects need to be destroyed in a custom expression

texts:
I'm using a custom (PyQGIS) function in expressions to make little detailed minimaps around each feature in a layer, and store it in the layer (gpkg) as a png.

My code works but makes QGIS (3.12) unstable, leading to eventual hangs after I use the custom expression in Field Calculator or forms. My hypothesis is that I'm foolishly relying on garbage collection to recycle some Qgs... objects that I need to destroy myself. Can anyone advise which ones? I've got a QgsMapSettings, a QgsCoordinateTransform, a QgsMapRendererJob, QByteArray and QBuffer any of which might be tripping me up. Since it's sporadic and sometimes freezes some time after my expression does its thing, it's time consuming to track it down experimentally...

def minimap_as_blob(geom,radius, xpixels, ypixels, feature, parent, context):
    # Set up map settings for the minimap based on the mapcanvas
    ms= QgsMapSettings()
    cms = iface.mapCanvas().mapSettings()
    destCrs = cms.destinationCrs()
    ms.setLayers(cms.layers())
    ms.setDestinationCrs(destCrs)
    ms.setBackgroundColor(cms.backgroundColor())
    ms.setExpressionContext(cms.expressionContext())

    # geom is in CRS of its layer, transform to CRS of map
    layer_id = context.variable('layer_id')
    sourceCrs = QgsProject.instance().mapLayers().get(layer_id).crs()
    if destCrs != sourceCrs:
        tr = QgsCoordinateTransform(sourceCrs, cms.destinationCrs(), QgsProject.instance())
        geom.transform(tr)
    ms.setOutputSize(QSize(xpixels, ypixels))
    # radius is size of buffer around geom, in destination CRS units
    bbox = geom.buffer(radius,1).boundingBox()
    ms.setExtent(bbox)

    # make map as a sequential job
    job = QgsMapRendererSequentialJob(ms)
    job.start()
    job.waitForFinished()
    img = job.renderedImage()

    # return the image as a QByteArray
    ba = QByteArray()
    buffer=QBuffer(ba)
    buffer.open(QIODevice.WriteOnly)
    img.save(buffer, "PNG")
    return ba

Editing to add: The article at https://machinekoder.com/how-to-not-shoot-yourself-in-the-foot-using-python-qt/ adds to my nervousness about relying on garbage collection, since there is apparently both Python's and Qt's destruction to worry about. It seems certain objects may need to be Qt5-.deleteLater()-ed rather than Python-deled. I'm really not sure how everything (including Qt's event loop and QGIS's job rendering) interact in a custom function invoked in an expression in Field Calculator or in a Form (where it currently lives inside a QML Widget!)


texts: Accessing internal QGIS clipboard in Python?

texts:
How can one access the internal QGIS clipboard (defined in C++ qgsclipboard) via Python/PyQGIS?

I've tried QgsApplication.clipboard() and QApplication.clipboard, both of which return a PyQt5 QClipboard object rather than a QgsClipboard.

I'd love to make use of features copied to the clipboard in native format (via the copyOf() method of QgsClipboard) but QClipboard seems to have only a text() representation.


texts: How to destripe the thermal band in SLC_off LandSat 7 ETM+ data?

texts: I am working on a special study in one of my subject. My study would require me to extract land surface temperature each year for 2007-2014. Since LandSat 5 ceaseed to operate last 2011, my 2012-2014 data are from LandSat 7 with SLC_off. How will I destripe the thermal band? I have ENVI 5.1.


texts:
i have a problem with HTTP request for KML to add to map. This is my HTTP request:

var x = new OpenLayers.Layer.Vector("X", {
    projection: new OpenLayers.Projection("EPSG:4326"),
    strategies: [new OpenLayers.Strategy.Fixed()],

    protocol: new OpenLayers.Protocol.HTTP({
                url : "../../MyJSP.jsp",
                async : false,
                    format: new OpenLayers.Format.KML({
                       extractStyles: true,
                       extractAttributes: true
                     }),

                params : {
                 'request' : 'typeRequest',
                 'param1' : 'a',
         'param2' :'b'
            }

            })

        });

        map.addLayer([x]);

The request is send to MyJSP, which make some controls to decide the remote method to invoke:

String req = request.getParameter("request")==null ? "" : request.getParameter("request");

if (req.equals("typeRequest")) {
   String param1= request.getParameter("param1");
   String param2 =   request.getParameter("param2");
   myClass.myMethod(param1,param2);

The request don't arrive here. I think that the problem is the URL ../../MyJSP.jsp.

-forder
 -- folder
 --- folder
       class to make request HTTP
-MyJsp.jsp

Can anybody help me? Thanks.


texts: Trying to merge 2 vector layers; one is of type "LineStingZ", the other is just "LineString".  When I run the merge algorithm I get the message saying "Error executing algorithm Merge vector layers All layers must have same geometry type!"; but when I try to do a save-as on the LineString layer and check the 'Include z-dimension' I get a new "LineStringZM" type and they still don't match.  Is there another way to specify the layer type?