texts:
I use a shapefile to create a regular grid using spsample, from sp package.

Two problems here: (1) I would like to define the size of my grid cells in meters, but I've checked the documentation of sp and it is not clear what is the default unit of measure ; (2) This code works to create hexagonal grid but I can't make this work to create a regular grid. Any ideas?

Here is a reproducible example:

# load libraries
  library(sp)
  library(rgdal)

Download a shapefile

URL <- "ftp://dnrftp.dnr.ne.gov/pub/data/state/Legislative2010UTM.zip"
fil <- basename(URL)
if (!file.exists(fil)) download.file(URL, fil)

# unzip & get list of files
fils <- unzip(fil)

# find the shapefile in it
shp <- grep("shp$", fils, value=TRUE)

# get the first layer from it
lay <- ogrListLayers(shp)[1]

# read in the shapefile
leg <- readOGR(shp, lay)

plot(leg)

Define size of hexagon bins

HexPts <-spsample(leg,type="hexagonal", offset=c(0,0), cellsize=100000)

# Create hexagon grid as spatial polygons
HexPols <- HexPoints2SpatialPolygons(HexPts)

plot(HexPols, add=T)


texts: Permissions are blank when trying to load satellite images from Planet API

texts:
I am trying to download the map of Melbourne using Planet API. I have given AOI coordinates of Melbourne. When I run the code the permissions are returning blank ("_permissions": []). I cannot able to view analytic_dn or analytic data to load the images.

import os
import json
import requests
from requests.auth import HTTPBasicAuth

os.environ['APIKEY']='HERE YOU INPUT YOU API
Key'

# API Key stored as an env variable
PLANET_API_KEY = os.getenv('APIKEY')

# will get a 4 band image with spectral data for Red, Green, Blue and
Near-infrared values
item_type = "PSOrthoTile"

# API request object
search_request = {
"interval": "day",
"item_types": [item_type],
"filter": combined_filter
}

# fire off the POST request
search_result = \
requests.post(
'https://api.planet.com/data/v1/quick-search',
auth=HTTPBasicAuth('APIKEY', ''),
json=search_request)

print(json.dumps(search_result.json(), indent=1))

This should return permissions for the particular coordinates. I don't
whether its the problem of my API ID or not.


texts:
I wish to use a special wms request for printing only.
full request looks like:
/geoserver/test_osm/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=osm%3Atest_layerset&format_options=dpi:300&TILED=false&CRS=EPSG%3A3857&STYLES=&WIDTH=724&HEIGHT=363&BBOX=3928863.2538580596%2C7362108.816315036%2C4371586.5216858005%2C7584081.946455188 , where WIDTH & HEIGHT and BBOX parametres are worked additionally of size of openlayers's map dom object..
but I have a problem: size of label,lines parts of layerset and a size of a polygon lines are not grow linear:
300 dpi:

same with 150 dpi:

How to fix it and what a reason?
May be I have to use more efficiently approach for printing


texts:
I am an Amateur user of QGIS and just started using OSM data as a part of a project where I need to create approximate postal code boundaries.
I used QGIS with OSM data to create Voronoi Polygons, then Dissolve them and last intersect them with the land map (so there are no polygons inside the sea).
When I load the OSM data (points) I get some attributes, but the one I really care is inside the other_tags with the name addr:postcode:
"office"=>"energy_supplier","addr:city"=>"Î˜ÎµÏƒÏƒÎ±Î»Î¿Î½Î¯ÎºÎ·","addr:street"=>"ÎšÏ„Î¹ÏÎ¹Î±ÎºÏŒ Î£Ï…Î³ÎºÏÏŒÏ„Î·Î¼Î± Ganas & Ganas","addr:postcode"=>"57001","contact:email"=>"thes@volterra.gr","contact:phone"=>"+302310475308","opening_hours"=>"Mo-Fr 09:00-17:00","contact:website"=>"https://www.volterra.gr/grafeia-thessalonikis"

Can I unpack somehow this attribute inside other_tags and move it along with the first level attributes?
The OSM I am using also can be found here.


texts: Duplicate layer using Control button on keyboard

texts:
I noticed in QGIS 2.14 I can hold Ctrl key and drag to duplicate a layer. But this seems to create a copy linked from source layer. Unlike if I use "Duplicate" in context menu this procedure reflects any modification (or rename) on both layers.

Does anyone know more about this feature? Or some way to identify a duplicated or linked layer.


texts: Extraction of DEM from netCDF file into ASCII XYZ format

texts:
I need to extract a DEM of a waterbody from a netCDF file so I can ultimately convert the DEM into xyz format. I'm not sure how to go about doing this, and so far, I have tried to create raster layers of the DEM in ArcGIS. However, I'm not sure if this is the best approach to obtain the data in xyz format.

If anyone could provide some ideas about how I would go about handling this conversion I would appreciate it.


texts:
I'm trying to use Drone Imagery Metadata to plot precise (or nearly precise) Imagery footprints on the the ground and I need some help with Photogrammetry / Trigonometry / Quaternions

My repo is located here.
I'm trying to port the calculations from this repo written in C#

I have code that can do it as long as the Camera is exactly NADIR, but it's not as accurate as I really need.  I should take into account the Gimbal pitch, roll, & yaw.  With DJI drones, this data is NOT relative to the aircraft, but entirely stand-aline (or so I'm told).

My math is close but I'm a bit off somewhere.  In the image below, the smaller polygons are made using NADIR hard coded and using the estimated GSD using the image size and focal length.

The larger polygon set is trying to utilize the pitch, roll, and yaw... but it's not right.  The dots are the camera's counterpoint at the trigger of the shutter.


texts: Table join with .csv file results in null fields after join

texts:
Similar to questions already asked about .dbf files, I'm attempting to join .csv files to a .gdb or shapefile coverage in QGIS.  The tables as added to QGIS prior to the join look fine, but after the join is complete, the amalgamated table has NULL values for all joined fields.  The same happens with a variety of different tables, and regardless of whether I'm joining to a shapefile or .gdb file.

I'm running QGIS 2.0.1 on a OSX 10.8.5.  The original table files are contained in .mdb format so I've purchased and used the MDB ACCDB Viewer to export them to .CSV  The fact that they are fine when viewed separately leads me to believe the issue is with the join procedure, not the tables themselves.

Suggestions?


texts: Using raster::rasterize's getcover to get total polygon area with overlaps

texts:
I want to use rasterize to get how much of a raster cell is covered by polygons. This can be done like this:

library(raster)

p1 <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20))
hole <- rbind(c(-150,-20), c(-100,-10), c(-110,20), c(-150,-20))
p2 <- rbind(c(-10,0), c(140,60), c(160,0), c(140,-55), c(-10,0))
p3 <- rbind(c(-125,0), c(0,60), c(40,5), c(15,-45), c(-125,0))
pols <- SpatialPolygons( list(  Polygons(list(Polygon(p1), Polygon(hole)), 1), Polygons(list(Polygon(p2)), 2), Polygons(list(Polygon(p3)), 3)))
pols@polygons[[1]]@Polygons[[2]]@hole <- TRUE

r <- raster(ncol=180, nrow=90)

r <- rasterize(pols, r, getCover=T)

plot(r)

But is it possible to make getCover account for overlaps, so that the cover can exceed 100 if there are more polygons overlapping?


texts:
I'm trying to find how i could animate a map online with no result.

I've an application that users can use to query place. The result include a map. All data are store locally on a server. Now i want the map to display some informations like from train station, move to the nearest hotel with animated 3D route and at the hotel location shows hotels pictures in popup or similar. So moving from place A to B shows an animated 3D route. Ariving at place B shows some animated pictures of the place (in 3D or 2D).

Is there any possibility to use a 3D program like blender (Or Adobe After Effect) to create surch animations live?

That is the moment the user enter the query, the map is displayed in an animated state and live.


texts: Creating new field with values from different fields QGIS

texts:
I have combined different layers (vector) in a merged layer. All layers had one specific land-use type, so now the new layer has fields called 'tree', 'paved', 'building', 'water' and 'plants'. All these fields either have value 1 or 0. (1 for when this feature has the specific land use and 0 if it doesn't). This means that all features only have one '1' (either in tree, paved, building, water or plants). The other of those fields will then just have 0.

Now I want to add those fields to a new field, so that this field has the type of land cover for each feature, (combine type of land cover into one field basically).

How do I do this?


texts:
I'm using ArcMap 10.1 I recently downloading some files that are in .adf format.

I need to convert them to .shp.

I just simply need step by step instructions of how to convert the data.


texts: QGS format : backward compatibility between QGIS 3 and QGIS2

texts:
Some of my users may want, before finally migrate to QGIS3 LTR, to read with QGIS2 some qgs project files made under QGIS3. I would recommend them not to do that.

But, for the sake of clarity:

How is backward compatible a qgs file from QGIS3 to QGIS2 ?
In this old post, there is a proposed answer by Underdark, for a QGIS 2.6/2.2 case. Would the answer be the same in my case?


texts: Copying feature from one layer while mapping fields in QGIS?

texts:
I am trying to copy features from one layer to another. What I would like to do is for QGIS to ask me which field should each field copy to.

For example, layer A has 4 features that I am trying to copy to layer B. Now layer A has 5 fields A1, A2, and so on. Similarly, layer B has 5 fields but with different names B1, B2, and so on.

Is there a way I can assign field A3 to copy to B1 and A5 to copy to B2?


texts: Losing edit ability for shapefile (converted from delimited text layer)

texts:
I have been running into a bug with my QGIS 2.16.3 project. It has to do with editing a shapefile after closing the QGIS project and restarting the computer.

So I have a spreadsheet of locations of interest that I plot on my map. I complete this activity by first converting my spreadsheet to a CSV file then adding a new Delimited Text Layer to my project. My spreadsheet has a column for X and Y coordinates so I assign them to the correct field in the "Geometry definition" section. The data points show up in the correct place in my map. After this, I would like this file to be a shapefile so I "Save As" the layer as a shapefile and I am now able to edit the attributes in the file. Everything is fine until I close the project and QGIS program.

When I open the QGIS project up again, my newly created shapefile is still a shapefile, however I have lost the ability to edit the layer. My traditional way around this would to "Save As" it again as a shapefile and I would regain the ability to edit. However, this means I have to copy over all the rules, filters, and layer attributes I assigned to this layer.

Added screenshots


texts: Why are results from Python tool not in Results window?

texts:
I am relatively new to ArcPy 10. and I want to return the list of feature class from a dataset. I can see them through the message, but cannot see them from the result window. Actually there are only inputs, environments and messages I can view from the results window. Am I missing something in the script? Thanks.

    import arcpy
    import json
    from arcpy import env
    env.workspace=r"C:\sde\pan18.sde"
    featureDatasets = arcpy.ListDatasets("SDE.POINT_OF_INTEREST")
    fd=featureDatasets[0];
    fcList=arcpy.ListFeatureClasses("*", "ALL", fd)
    pf=[]
    for fc in fcList:
       pf.append(fc)
    arcpy.AddMessage("--------Encode the list to a json string-\n")
    layerlistEncode=json.dumps({'resource':pf})
    print layerlistEncode
    arcpy.AddMessage("--------Encode the json string to a list\n")
    layerlistDecode=json.loads(layerlistEncode)
    print layerlistDecode
    print layerlistDecode["resource"]
    arcpy.SetParameterAsText(0, layerlistEncode)

    arcpy.AddMessage(layerlistEncode)
    arcpy.AddMessage("finished1")

Edit / Delete Edit Post   Reply With Quote Reply With Quote   Multi-Quote This Message  Top Bottom


texts: Exploding multipart features in qgis using python

texts: I want to explode a multipart layer to singlepart in python. I see through the qgis gui there is a way to do it under vector--geometry--tools--Multipart to Singleparts.. which does what I need, I just need the python code for this. I'm new to qgis.


texts: Changing style of only selected polygons in L.geoJSON layer?

texts:
So, I'm going to show a lot of polygons in my Leaflet map but I need an id for each polygon, the URL comes in a path like this.
In fact I wouldn't even need an id, if I could somehow get some properties like that, like stroke = red would work for me, because I want to change a property when the path is in red.
<path class="leaflet-interactive" stroke="red" stroke-opacity="0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="red" fill-opacity="0" fill-rule="evenodd" d="M477 171L469 171L468 176L455 175L455 171L459 171L461 167L465 167L467 163L471 163L472 160L479 153L488 148L493 147L494 158L489 159L487 163L477 167L477 171z"></path>

My code for all polygons
 L.geoJSON(polygon, {
        style: function (feature) {
          return {
            stroke: true,
            fillColor: feature.color,
            fillOpacity: feature.opacity,
            color: feature.color,
            opacity: feature.opacity,
            weight: 2,
          };
        },
      })
        .bindPopup(function (layer) {
          return layer.feature.properties.name;
        })
        .addTo(map);

and the function that will change, but in this way is not working
      case 3:
        const elm3 = d3.selectAll(`g path[style = "fill: red"]`);
        elm3.style('opacity', checked ? 0 : 0.7);

        break;


texts: QGIS Qt Designer set current date and time in mask

texts:
I have created an input mask for QGIS using the Qt Designer. Everything works fine but I have a small issue with the date, the time and the date/time edit widget. Is there any way to display the current date or time in this fields? when using the default form from QGIS it displays the current date or time. When using a mask from Qt Designer the date is always 01.01.2000 and the time is 00:00:00, which are the default settings for the widgets in the Qt designer. I think there must be a setting inside Qt which I haven't found yet.

Using QGIS 2.12 and 2.14 with Windows 7 and Windows 10. Always the same.

Best regards


texts: Simple marker anchor point settings get back to default after saving the shapefile in QGIS

texts:
On QGIS 2.8 I am trying to use data definition to define a cliff hashmark.
I have created a style for the line with a simple marker and plan to use the vertical anchor point offset to move the marker to the proper side of the line.
I have created a string field and enter "bottom" or "top" into the field. After creating the line the hashmarks are displayed correctly. However, as soon as I save the shapefile it defaults back to a centered anchor point.
Am I missing a step somewhere or is this a bug?


texts: Accessing asset objects and working with them in GEE

texts:
I have some areas defined by square polygons and saved as tables in my GEE assets. I want to read them one by one, enlarge them and save the enlarged box to my assets again. I wrote below code but it doesn't do anything:

var Tables = ee.List(ee.data.getList({id:'myassets/boxes'}))
var l = Tables.length()
for(var i=0; i<l; i++){
  var box = Tables.get(i)
  var g = b.geometry()
  var box2 = g.buffer(1000).bounds();
  Export.table.toAsset({
    collection: box2,
    assetId: 'Box2_'+string(i)
  })
}

What is wrong with it?


texts: Programming a Tessellation in MATLAB and Using Map Data As Input

texts:
First of all, I hope this question isn't too basic, obvious or inappropriate for this forum. I'm very new to using map data. I'm working on a project on locating service terminals in a geographic region. Abstractly, given a simply connected region in the plane (for the purposes of what I'm doing, a contiguous map, say a map of the contiguous United States), I want to approximately cover this map with non-overlapping circles that lie completely in the boundary. (This is only part of what I'm doing, but it's the relevant part). I'm working on programming an algorithm for this in MATLAB.

My question related to this is:

I have map data in I've downloaded from TIGER (http://www.census.gov/geo/www/tiger/tgrshp2009/tgrshp2009.html) I've successfully opened this map data in MATLAB using the Mapping toolbox Map Viewer. What I want to do is to take this nice looking map data and store it in format I can use.

A crucial part of the algorithm I'm implementing has a step that is:

Given a point (x,y), calculate the distance from this point to the boundary of the region. For my purposes, this is Euclidean distance, i.e., the length of the shortest straight line from (x,y) to the boundary.

What would be a way to go from the TIGER data (which gives me a nice picture of the map) to a format that I can easily calculate the above step?

Thank you!


texts: Distinguishing between invalid raster files and valid ones at using arcpy functions

texts:
I am trying to move raster files from one location to another.

By using the function: ListRasters (arcpy), I can get the list of rasters to be moved, but the problem is that even corrupted rasters are listed by this function. Actually if you use ArcCatalog and navigate to the folder, everything seems to be right and valid and invalid rasters are listed together but if you try to preview a corrupted one, it will pop-up:

In detail, I am talking here about several corrupted Esri GRID rasters. How to differentiate them?

So, when I use the function: Copy (Data Management), arcpy rises an error when trying to move an invalid GRID.

I was trying to solve this issue by using any of the properties of the Describe function: Describe object properties (arcpy), and getting any difference between the valid ones and the invalid ones, but this function raises an error on invalid datasets, so it cannot be used.

for raster in arcpy.ListRasters():
  desc = arcpy.Describe(raster)

Runtime error
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 1200, in Describe
return gp.describe(value)
  File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 374, in describe
self._gp.Describe(*gp_fixargs(args, True)))
IOError: "raster" does not exist

Any ideas?


texts: Set tolerance for intersection in Geopandas?

texts:
I want to set tolerance 10^-8 for the intersection.

inte_s=gpd.overlay(shp,shpa,how='intersection')

How can you do that?


texts: Creating Shapefile spatial index programmatically in .NET?

texts:
I am creating a shapefile programmatically using DotSpatial using the following example syntax / pseudo code

FeatureSet features = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon);
features.DataTable.Columns.Add( … // add column names and types

foreach (var featureData in featurDataCollection) //loop adding many features
{
    IGeometry feature = …  // create feature with attribution + geometry
    features.add(feature);
}

features.SaveAs(filepath, true);

I would like to ensure the output ShapeFile has a spatial index.  Is there a way to do this programmatically in .Net, (preferably using the DotSpatial libraries).

It would appear that in my naiveté that I have asked a more difficult question than I thought.  It seems that the .sbn format is not as open as the other shapefile formats and there has been some work on reverse engineering this.  There also seems some mention of a C# implementation that creates .sbn files but I am still trying to figure this out.


texts: I checked the API doc, there seems to be no fill-extrusion-outline property exist. Basically is to change the outline color of the 3D extrusion. Is there a way to do that?


texts: Using python to take coordinates of a layer and input them to r.lake

texts:
I am running r.lake in the graphical modeler in QGIS as a component of a geoalgorithm I am working on.

At the moment the coordinates input for r.lake will only take a manual string input, I am wondering is there a way to create a python script that will take the coordinate values of a vector seed layer and input these as the coordinates.

I understand that I will have to iterate / loop over the vector layer if there are multiple coordinates involved.

My python knowledge is that of a beginner, so I am more comfortable with the graphical modeler interface for such tasks. If a script can be linked in the graphical modeler that would be great.

Script is now working well with the addition of several processing algorithms included to vectorize and run spatial query. However, where the spatial query should not return results, blank shapefiles are being produced.

See sample code below:

##Karst Surface Flooding=name
##DEM_input=raster
##Seed_vector_points=vector point
##Overspill_vector_boundary=vector polygon
##output=folder

# Import classes
from qgis.core import QgsRasterLayer
from qgis.utils import iface
from PyQt4.QtCore import QFileInfo
import processing

# Define layers
point_layer = processing.getObject(Seed_vector_points)
layer = processing.getObject(DEM_input)
boundary_layer = processing.getObject(Overspill_vector_boundary)
fileName = layer.source()
fileInfo = QFileInfo(fileName)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(fileName, baseName)

# Get extent of the region
extent = iface.mapCanvas().extent()
xmin = extent.xMinimum()
xmax = extent.xMaximum()
ymin = extent.yMinimum()
ymax = extent.yMaximum()

for feat in point_layer.getFeatures():
    geom = feat.geometry()
    attr = feat.attribute("Z_ADD_1")
    i = 0
    while i < 5:
        output_1 = processing.runalg('grass:r.lake.coords', layer, "%f"%(attr),
"%f,%f"% (geom.asPoint().x(), geom.asPoint().y()) , False, "%f,%f,%f,%f"% (xmin, xmax, ymin, ymax), 0.00, None)
        output_2 = processing.runalg('saga:rastercalculator', output_1['lake'], '','a>0', False, 3, None)
        output_3 = processing.runalg('gdalogr:polygonize', output_2['RESULT'], "DN", None)
        output_4 = processing.runalg('qgis:dissolve',output_3['OUTPUT'], True, "DN", None)
        output_5 = processing.runalg('modeler:overspill_select', output_4['OUTPUT'], boundary_layer, output + '/' + baseName + "_%.6f_%.6f" %(geom.asPoint().x(), geom.asPoint().y()) + '_' + "%.2f"%(attr) + 'm' + '.shp')
        i += 1
        attr += 0.5


texts: What GIS-related services have been affected by past U.S. government shutdown?

texts:
I noticed data.gov, the US government's open data (including GIS) clearinghouse, was down, reading the following message:

  Due to the lapse in federal government funding, this website is not
  available. We sincerely regret this inconvenience.

  For information about available government services, visit USA.gov.

Similarly, usgs.gov is down, with only critical USGS websites available:

  Ecosystems

  Disease Maps

  Natural Hazards

  USGS coastal erosion hazards information
  USGS earthquake information
  USGS emergency operations portal
  USGS information on geomagnetic activity
  USGS landslide information
  USGS volcano information

  Water

Presumably this is only a temporary outage. Are there any other services that have been affected, and any permanently?

Update: Now that the US government has reopened, all of the sites linked so far in this thread appear to be back up.


texts: In hydrologic terrain analysis is there a difference between "pits", "depressions", and "sinks"?

texts:
In hydrologic terrain analysis is there a difference between "pits" and "depressions"?

For instance, Planchon and Darboux (2002) state

  The usual numerical methods for removing the depressions of a Digital Elevation Model (DEM) gradually fill the depressions and merge the embedded ones.

While Grimadli et al (2007) states

  Spurious pits in digital elevation models (DEMs) are traditionally removed by filling depressions, often creating flat regions that lead
  to inaccurate estimation of landscape flow directions. In this study, a physical approach based on a simple landscape evolution model is
  proposed for DEM pit removal.


texts: PostGIS st_makeline extra columns in result

texts:
From a table of point data, there are some groups of points that can define a line (cross sections of a water course). 'cross_section' is the name of the table with the point data, geometrypoint the column with the geometry. 'code_sequence_nr' is the column that specifies the point sequence, so it becomes a nice line.
To make lines from groups of point data I have the following query:

CREATE TABLE cross_section_lines AS
SELECT st_makeline(geometrypoint) as cross_section,
        cross_section.profile_code,
        cross_section.administrative_area_id,
    FROM (SELECT geometrypoint, profile_code, administrative_area_id
        FROM cross_section
        ORDER BY code_sequence_nr) cross_section
    GROUP BY cross_section.profile_code, cross_section.administrative_area_id;

Now I need more information than the columns used for grouping, but if I add a column like this:

CREATE TABLE cross_section_lines AS
SELECT st_makeline(geometrypoint) as cross_section,
        cross_section.profile_code,
        cross_section.administrative_area_id,
        cross_section.profile_type_id
    FROM (SELECT geometrypoint, profile_code, administrative_area_id
        FROM cross_section
        ORDER BY code_sequence_nr) cross_section
    GROUP BY cross_section.profile_code, cross_section.administrative_area_id;

The following error occurs:

ProgrammingError: (psycopg2.errors.UndefinedColumn) column cross_section.profile_type_id does not exist

But that column is certainly there. Now how do I add the profile type (and other usefull columns) to the resulting table that is created?


texts: Applying Mapnik style for OpenStreetMap data in ArcMap?

texts:
I am loading OpenStreetMap vector data into ArcMap (using the Download and Symbolize OSM Data tool of ArcGIS Editor for OpenStreetMap 1.1). I'm sure there must be a simple way to apply the style/symbols of the Mapnik baselayer as rendered on the OSM website (example), rather than using the ArcMap defaults or manually adjusting symbology for each feature type, but I just can't figure it out.

Can someone point me to a potential solution?


texts: Downloading ROI Explorer plugin for QGIS?

texts:
I'm following a tutorial about classifying pixels colours into categories and need to download the ROI Explorer plugin. Can't seem to find it anywhere however.

Does anyone know how I can get it or if there's an alternative?

My plan is to classify certain colours in satellite imagery so as to get an idea of % forest cover.


texts:
I'm trying to convert a file using gdal-translate and keep getting a "Permission Denied" message.  Looking online (including here) the solution is usually to make sure you have write access to the directory.   Everything is being done locally, I'm a local admin, I created the directories and just to be safe went in and added myself into the folder security with "Full Control".  In trying to figure this out I've gone as far as logging in as the domain admin and still get the permission denied error.

Anybody have any ideas on what to try next?  User permissions should not be the cause here.


texts: What is this?( raster or vector) and How to show the raster image from an GeoTIFF?

texts:
I have a TIFF file:  http://files.sweetysoft.com/image_after_2021_05_19/3653/China_2020_1km_UNadj.tif
When open it with windows image viewer, it only shows China Map like this:

When open it with ArcMap, I can see the "raster" stuff like this:

What is the name of the blue circle area?


texts: How to force network analyst to use metero station?

texts:
I'm new to use multimodal network analyst .I use esri tutorial for multimodal network analyst.It was very interesting for me .What i need is that i want to force network analyst to use metero station for network analyst .for example in esri tutorial multimodal network i don't want to route from street to street like the below image and i'd like to use metero station.How can i force network analyst to use metero station ?

thanks for advance


texts: How can save and restore my map's extent with GeoExt?

texts:
I'm using GeoExt with OpenLayers and trying to save the extent of the map. while exploring the page, users can be able to save the extent and restore via their browsers.

Here is the point that I'm stuck:

how can I catch mousewheel's actions to save the extent of the map and keep it in cookies?

any ideas?


texts: I am looking for a library or API to do vector overlay for two map layer (shapefiles or GML files)

texts: I need to perform vector overlay operation on any two map layers as ArcGIS and Grass GIS performs. I am wondering is there any API or library ( in C, C++ or Java) so that I can use that third party library for my GIS project. I am looking forward to find intersection between two map layers using that library.


texts: How to explain the spatial relation of forest loss hotspots with several others variables

texts:
I am doing a research in categorizing and ordering of the factor affecting/fostering the creation of the forest loss hotspots. I have following data.

Point location of forest losses from which i generated polygon using
kernel density.
Euclidean distance raster of several variables like several types of
roads, brick kilns(that uses trees as fuel),location of local market
where fallen trees are sold, forest guard posts and others that may
have      relation to the creation of forest loss.

I see there is a relation like loss hotspots tend to be closer to roads and distant to the location of the forest guard post.

Now my question is:

How can I spatially/statistically explain above phenomenon?

Update: My model details:

I have ~80000 loss and ~80000 non-loss(randomly sampled)
I have ~70 predictors


texts: Sorting data based on selection queue using ArcMap

texts:
I have some polygons which have sequential ID if they are in the same row.
I want to select the polygons of one row and to sort them based on the way I selected.
They are sorted based on FID.
Is there any option?


texts:
I have a set of Arcmap map templates, the toolbars within them at one time where fixed in position. Now for whatever reason, every time I or another open the template the ordering of the toolbars has changed.

Any Idea how to fix this?

****Research****

May be related to this bug.

Is ArcGIS Desktop still affected by stacked toolbars bug (NIM003161) when opening MXD on multi-monitor configurations?


texts: Adding Raster to Table of Content in ArcPy without losing information on General tab on layer properties?

texts:
I use the following python script to generate the layer file (.lyr) from raster in Geodatabase

import arcpy

raster = "Raster path in gdb"
LYRpath = "C:...\layername.lyr"

arcpy.MakeRasterLayer_management(raster, "RasterName")
arcpy.SaveToLayerFile_management("Rastername", LYRpath, "RELATIVE", "10")

However, the layer file is missing information on the General tab (Description and Credit) on Layer Property. Am I missing a step here?


texts: Using different resolution for two overlaying layers?

texts:
If I have 2 layers: one satellite image (15m resolution) and one relief (about 30m resolution).

Can I overlay the relief with some transparency over the satellite image?

It obviously "works" but is it wrong?


texts:
I was trying to merge 2 DEM raster using QGIS raster - merge.

Is there any way to not add nodata to the merged raster?


texts:
How do I compare tropospheric_NO2_column_number_density(mol/m^2) of
  Sentinel-5p with EPA statewide emission data which unit is
  Ton or lb?

Goal:
My goal is to compare remote sensing no2 emission to bottom-up no2 emission for electricity generation.

Current progress:
I have calculated the total yearly emission of no2 for California. The data used for this is Sentinel-5p OFFL NO2 stored in Google Earth Engine. I first take the yearly sum of no2 (tropospheric_NO2_column_number_density) and use gee reduceRegion function to get a sum of yearly no2 of California.

I want to compare that value with EPA emission data which contain yearly statewide emission data. But the problem is tropospheric_NO2_column_number_density unit is mol/m^2 and EPA emission data in ton or lb.

  Question: So how to compare these two value of the different units?

After searching I found this post in sentinel-5p forum which discusses converting mol/m^2 to ppb. But this doesn't solve my problem.

EDIT: After seeing @xunilk detailed answer, I came to know we can convert mol/m^2 to lb/m^2 and my question needs some clarification. If we convert and sum entire year no2 of a state then our final value's unit will be lb/m^2. For example, California yearly total no2 emission from s5p satellite is 104 lb/m^2. On the other hand, our bottom-up emission data describes that California yearly emission is 30000 ton. So how can we convert this lb/m^2 value to only ton ( not ton/m^2 ) and also how to convert lb/m^2 to lb (not lb/m^2)? Could we just multiply the entire California area in m^2 or is there any way to do that in satellite imagery?


texts: Baffling Elevation Profile out of Profile Tool Plugin

texts: When using the Profile Tool plugin I get a graph that looks like the 2nd derivative of what I want. That is, it looks like the rate of change of the slope of the elevation profile. I just want the elevation profile! The data is present for good 1' contour lines. Why is the Profile Tool interpreting the data in such a bizarre way? What am I missing? And what are the Min and Max units?


texts: When creating XY Feature in Arcpy, null values resulting in field being text not numeric

texts: I'm trying to create a feature class from a csv / tab delimited file. All the fields in the file are numeric, but some have null values, and those fields are being coerced into "text" types. (actually, only the SECOND time I run the create XY layer. The first time it's fine, and it's fine if I delete Scheme.ini). Any advice for a workaround?


texts: Determining area calculations in edit session uisng ArcGIS Desktop?

texts:
Does anybody know how to determine area calculations for polygons during an edit session using ArcGIS Desktop 10.4?

I want to be able to see the size of the polygons in hectares as I edit them or create new polygons. Ideally the area calculation would change colour if the area of the polygon falls below a specified value.


texts: Seeking open source alternative to ArcGIS Desktop's Integrate tool?

texts:
I need to snap about 1000 lines in one layer to the lines in another layer (there are about 5000 lines in the second layer). The lines to be snapped are about 15 map units away from the base layer lines. It looks like ArcGIS could do this using the Integrate tool in the Data Manager toolbox.

Is there a QGIS/GRASS/SAGA/other open source alternative to Integrate or will I need to crack open my Python skills?


texts: Dealing with two different coordinate systems in PostGIS

texts:
I'm seeking a function that converts degrees to the following format:

POINT(405115.926025391 4543389.4354248)

I don't know this format's name, but is there any function to do so?

EDIT ------- > converting SRID

WITH currentPoint AS (
    SELECT
        st_transform(st_setsrid(st_makepoint(3.6392182823950043, 37.74446159789074), 900913), 900913) AS point
)
SELECT
    building.gid
FROM
    building, currentPoint
WHERE
    ST_Dwithin(building.geom, currentPoint .point, 10)


texts: Using ArcPy to assign Hyperlinks to features?

texts:
Background:

Currently we manually update the file path for a polygon field to hyperlink to tiffs of registered plans for our fabric records (we use Parcel Editor currently using ArcMap 10.2.2). The problem is we can/and have forgotten to update the field for given polygons for any number of reasons. Ideally, using a python script to look for tiffs based on standard naming conventions would be amazing!

Current Code

What I have had success doing so far:

in the layer properties under the display tab, I check on "Support Hyperlink using field:", with the field "NAME"
Updated the radio button to Script and used the following script:

import webbrowser, os
def OpenLink ( [Name] ):
    for r,d,f in os.walk(r"\\ref\ref\scanned_rp"):
        for image in f:
            if image.startswith(str([Name])):
                webbrowser.open(os.path.join(r,image))
    return

This will eventually open the file requested, but due to the many subfolders and hundreds of tiffs in each subfolder it takes 2 to 3 mintues to return the results.

Desired Outcome:

Speed up the search results.
Open only the first file with a similar name (if possible)

As our file names are standardized. The polygon layer name for a 2016 file, for example, would be 1610000. In the year subfolder, the tif would be named 1610000.tif.

The original source of python script came from here: http://support.esri.com/cN/knowledgebase/techarticles/detail/41382).


texts: Create GeoJSON after processing.runalg('qgis:clip', ...)

texts:
I have the following problem:
I have two vector layers, foobar and clipLayer. About the python console I call the following command:

processing.runalg ('qgis:clip', 'foobar', 'clipLayer', None)

As a result, I get the temporary path to a Shp-file. That is so far correct. But I need the result not as a Shp-file but in a GeoJSON format.

How can I convert the shapefile to the GeoJSON format?
There is a convert function within the GDAL tools.

processing.runalg('gdalogr:convertformat', input_layer, format, options, output_layer)

As a result, I get the path to a file .shp.geojson. but I want to get a GeoJSON string as a result.

Why do I need this?
Within a plugin the clip function is used. The result must be further processed as a Qgsfeature. In this case I can not use a shp file.


texts: Dissolving polygons closers than 50m into a single shape QGIS

texts:
I’m new with GIS (coming from a CAD background) and using QGIS 2.0.1. I have a very detailed map of urban fabric in a UK region, to the detail of individual buildings.

I want to simplify that map by uniting regions where buildings are closer than 50m to each other into a single shape. Areas with more disperse urbanization should not be considered - polygons here should be deleted.

The result would be a land use map with polygons delimiting areas of dense building, rather than individual shapes for each unit. I suspect that the “Buffer” tool would do the job, if I choose 50m as buffer distance and combine the buffers into one region.

Before I set out to do it, am I thinking right about this? Or is there other way to do it accurately? Thanks!


texts: Getting ArcGIS Desktop to project shapefile?

texts:
I am using ArcGIS 10.1 (SP1). I got a shapefile with polygons representing some features of the landscape in my study area. This file has been provided by a third party institution.

The coordinate system is missing spatial reference, as ArcGIS informs me as soon as I feed the file into ArcMap. I tried to use 'Define Projection' tool, but nothing happens, i.e. when I add other feature classes created by me (and that matches one another) the shapefile into question does not 'match' the rest of the layers.

Upon further inspections, I realized something that puzzles me even more. I am seeing that, if I take into account a given point in the map, its coordinates correspond to the actual coordinates in the right coordinate system (namely, ED1950 UTM Zone 33N) but are stripped of the first couple of digits. For example: 'true' coordinates of a point 439811 / 3986516, corresponding coordinates in the problematic shapefile 39811 / 86516; so, the first is missing the first digit, the second is missing the first two.

I would like to know if there is any way to fix this problem?

What I seem to understand for sure is that ArcGIS does not recognize this insane 'stripped' version of the ED1950 UTM Zone 33N.


texts: Combining polygon file with multiple overlapping polygons to represent only 1 attribute in given area e.g. highest/lowest/average in ArcGIS Desktop?

texts:
I have a large shapefile that I'm working with in ArcGIS 10.5 with an ArcInfo license.

At any given location in the file there are multiple polygons.

In the example I am working on there is a particular value; overlapping animal ranges.

There is a value associated with each of these ranges (polygons), and I'd like simply represent the largest value of several overlapping polygons (I might also want to show the high, low or some other statistics).   So any given area will be represented by a single polygon, and a single area.

I was able to dissolve and 'split' the overlapping .shp file into it's constituent parts and I tried 'unioning' them back together with the largest value as the highest priority.

I also tried 'merge' with no luck.  This seems like it should be simple,  but I keep running into a brick wall.


texts: Adding a column of WKT format in the table (postgreSQL)

texts:
I want to include this column of data that are in WKT format (they are mostly straight lines). What data type should I use?

I need to create this database for mapping. There are about 30000 features and their magnitude will be colour mapped and shown in 300 time intervals.

The database will be in this format:

magnitude; time; WKT coordinate

4; 2015-01-01; (642044 4862161, 642319 4862144)

I am wondering what column type should i input for the WKT column


texts: Using OSRM to create isochrones in R potentially problematic at < 10 minutes drive time?

texts:
I'm working on creating isochrones in R using osrm, and I keep finding problems with 0-10 minute travel times. Here's some code I've been using to test with a hand-picked test location:

install.packages("osrm")
install.packages("leaflet")

library(osrm)
library(leaflet)

locations <- tibble::tribble(
    ~place,       ~lon,     ~lat,
  "Albany", -73.767699, 42.652451)

iso <- osrmIsochrone(loc = c(locations$lon, locations$lat), breaks = seq(from = 0,to = 60, by = 10))

iso@data$drive_times <- factor(paste(iso@data$min, "to", iso@data$max, "min"))

factpal <- colorFactor("RdYlBu", iso@data$drive_times)

leaflet() %>%
  setView(mean(locations$lon), mean(locations$lat), zoom = 7) %>%
  addProviderTiles("CartoDB.Positron", group="Greyscale") %>%
  addMarkers(lng = locations$lon, locations$lat) %>%
  addPolygons(fill=TRUE, stroke=TRUE, color = "black",
              fillColor = ~factpal(iso@data$drive_times),
              weight=0.5, fillOpacity=0.2,
              data = iso, popup = iso@data$drive_times,
              group = "Drive Time") %>%
  addLegend("bottomright", pal = factpal, values = iso@data$drive_time,   title = "Drive Time")

Which gives me the following map:

Which looks good until you zoom in and notice that the latitude and longitude I put into the code (represented by the marker) is not in the 0-10 minute drive isochrone; instead it is in the 10-20 minute drive isochrone.

Does anybody have any idea why the osrmIsochrone code appears to be using a different point for creating the isochrones?


texts: How to use gdal ogr2ogr to subset features by attributes stored in a csv?

texts:
I have a very large GDB file with about 5000 polygon features, several GB in size, that takes a very long time to load into memory. I want to reduce the number of polygons to something I can work with more easily. The polygons have an attribute SCINAME and I have a .csv file with a list of a few hundred SCINAMEs. How can I construct a call to ogr2ogr to create a new .shp file that is a subset of the original GDB only including the polygons that have a SCINAME found in my .csv file? Or is there a better command-line way to do it?

Edit: I made a shell script with a while loop to do this, but it is running extremely slowly. Please take a look and see why it might be so slow.

while read line; do
    echo $line
    ogr2ogr -append -where SCINAME="'$line'" -f "ESRI Shapefile" ./output input.gdb/ "Feature_class_name"
done < scinames.txt


texts: Make a GIS map searchable on ArcGIS Desktop

texts:
I have a georeferenced photo image. Each point in the map corresponds to the exact latitude/longitude on the ground. The map also has names of cities but I can't use those names for searching.

Is there any way that I can make the map searchable such that, if I want to pan/zoom to a certain portion of the map, just the name of the city/county or state would be enough.

Right now, I am first using Google maps to find the area and later in ArcGIS.


texts: Importing GDAL from Python window of ArcGIS for Desktop?

texts:
I am trying to run some Python code using the Python window in ArcGIS 10.1 that uses both the arcpy and gdal modules. However, when I try and import the gdal module I get an error:

ImportError: No module named osgeo

Obviously it can't find the module, so I have added my main python site-packages directory to the sys.path list:

sys.path.append(r"C:\Python27\lib\site-packages")

However, when I try and run import osgeo or from osgeo import gdal I get the following error:

Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: DLL load failed: %1 is not a valid Win32 application.

I've found various resources on the internet that seem to talk about similar problems (for example this question and this forum post, but they seem to be out-of-date (ie. not using ArcGIS 10.1) or not asking quite the same question.

Of course, importing osgeo from a normal non-Arc Python window works fine, and I have compared sys.path and os.environ['PATH'] between the scripts and updated them so that they are the same, and it doesn't seem to fix the problem.

Does anyone have any idea how I can get this to work?


texts: Coordinate/projection system issue in ArcGIS 10.3

texts:
I am facing a problem, my shapefiles are in a GCS WGS 1984 and I have to add a new shapefile that is in a projected coordinate system NAD 1983 UTM Zone 8.

I have tried changing the projection to the GCS, and changing my GCS to a projection... but nothing seems to work.

I took a look to the similar questions and I tried changing the coordinate system and/or the projection with the "projections and transformations" tools (project). I also tried to project the files too.

The second image shows the shapefile I want to add to my map.

I am new in this community and I am also a new user of ArcMap.


texts: Harmonizing feature class definitions from many geodatabases

texts:
I just started a new job and we have about 20 different clients.  Each client has their own database with totally different schemas.  I'm trying to combine all of the schemas into a blank database that covers everything with data in it.  I have my first version (asset_v1.1).

It's very messy getting them 'migrated' into each database with all of the attributes coming along.  Once they are moved I know they are at least good locked down with new subtypes and domains.  The problem I'm running into is older employees are wanting to add or take away attribution.  I'm now on version 1.4 of it and don't want to keep loading data for 20 databases with several feature classes within those.  Basically I want to know if there's a way to take a database (1.4) and be able to add a field in a feature class and copy it to the new one (1.5) without having to load each feature and appending the data?

The end result I want every client to have the exact same database format.  Some of our techs work for a client for a couple months then don't know where anything is in another clients database.  Also having the same databases, I'm able to run scripts and update them much easier than customizing each one. Right now they're File Geodatabases, with hopes of getting everyone on SDE.  Everything needs to be cleaned up before that would happen.


texts: Strange behavior with WFS/WMS requests in OpenLayers

texts:
I have build a web application in which I use OpenLayers to display data on a map.
I use GeoServer to serve my data. Till a specific zoom level I display a raster WMS (road network) and after this zoom level I remove the WMS layer and make a WFS request, which returns features (using bbox strategy).
Everything works fine. The speed is also quite satisfying.
But I saw something in my firebug which I don't quite understand.
This is what it happens:

I have adjusted in zoomLevel = 11 to make the WFS request and remove the WMS layer.
When I zoom in and reach this zoom level indeed I see (in firebug) two POST requests (WFS) to be sent. I see the response etc. Everything is fine.
The strange thing happens on zoom out. On zoom out although everything seems to work fine (WFS layer disappears and WMS layer appears) I see on my firebug that two WFS POST requests are sent (the same as before) and I get the same response. The exact same requests I make on zoom in happen also on zoom out (only for this zoom level).
Nothing is rendered on the map. Just the POST requests are made but not displayed.

Obviously is something small that I am missing here.

Here is part of my code:

   // CREATE LAYER WITH NETWORK FROM GEOSERVER
    wms_layer_network = new OpenLayers.Layer.WMS( "Whole Network", "http://localhost:8080/geoserver/gwc/service/wms", //http://192.168.2.6:8080/geoserver/wms
        {
            layers: 'rural:foc_network',
            transparent: true,
            tiled: true
        },
        {
            format: "image/png",
            visibility: true,
            displayOutsideMaxExtent: false,
            projection: new OpenLayers.Projection("EPSG:900913")
        });

      map.addLayer([wms_layer_network]);

       map.events.register("zoomend", map, function(){ // event zoomend
          zoom = map.getZoom();
          var layerNetwork = map.getLayersByName('Network Part'); // check if the layer network exists

        if((zoom==valueZoom) && (layerNetwork.length==0)){

              // OVERLAY WFS LAYER WITH NETWORK FROM GEOSERVER BBOX STRATEGY
                wfs_layer_network = new OpenLayers.Layer.Vector("Network Part", {

                    <!-- DEFINE STYLE FOR LINES -->
                    styleMap: featurestyleMap,
                    visibility: true,
                    //displayInLayerSwitcher: true,
                    strategies: [new OpenLayers.Strategy.BBOX()],
                    protocol: new OpenLayers.Protocol.WFS({
                        version: "1.1.0",
                        url: "http://localhost:8080/geoserver/wfs",
                        featurePrefix: "rural", //workspace from geoserver
                        featureType: "foc_network", //layer name from geoserver
                        featureNS : "http://www.opengeospatial.net/rural", //namespace from geoserver
                    })
                })
                map.removeLayer(wms_layer_network);
                map.addLayer(wfs_layer_network);....


texts: Reference SQLite layer in QGIS by 'layername' instead of 'layerid'

texts:
In QGIS, when I add a vector layer from a SQLite database, the "Layer Source" in the properties dialogue is referenced by 'layerid':

C:/lookup.sqlite|layerid=4

However, what I want to do, and, what happens by default on my colleagues computer when they add the same vector layer from the same SQLite database the "Layer Source" is referenced by 'layername':

C:/lookup.sqlite|layername=roadsegments

I am using QGIS 2.18.7.  My colleague is using QGIS 2.12.  Is the reference method to an SQLite an option that can be set, or, related to the version of QGIS, or, something else?


texts: Plot x,y coordinates on a Polyconic Map Projection

texts:
I have an image of a large polyconic map projection:

(Note that the actual image is much larger, I just made it smaller to upload it.)

I would like to take in a user's GPS coordinates and plot where they are on this map in a Java program.

I attempted to follow the directions in this paper (Map Projections: a Working Manual, page 128):

https://pubs.er.usgs.gov/publication/pp1395

I can not seem to get an accurate location. When using -82.25 as my central meridian, 43 as my origin latitude, I tried to plot -84.5, 43, but received a location too far to the southeast. The marker should (theoretically) be at the intersection of the two lines west and north of it.

Is this not the correct equation? Is it just human error? At this point, I know that I am not having a problem with the conversion from degrees/minutes/seconds to degrees.decimal, and I also am running the equation with all values converted to radians.


texts: Creating Land Cover Change Classification in R?

texts:
I have two Land Cover (LC) classification raster over the same area and the same cell size. One from the year 2018 and the other from the year 2014. Both raster are classified with the values 1 - 6, where each value represents a different LC type.

Now I would like to calculate the change of LC between 2014 and 2018.

For instant I would like to know how many pixels with LC type 1 in 2014 still have LC type 1, and how many have new LC type 2 or LC type 3 and so on...

The same for pixels with LC type 2, 3, 4, 5 and 6 in 2014.

The output would probably be something like a correspondence matrix.

So far I have looked into the Package ‘lulcc’ and Package ‘diffeR’ but couldn't figure it out yet.


texts: How to find gaps in a tile and geometry of tables in a faster way

texts:
I have a table that contains polygons within a tile and it is huge. I want to find the gaps in a tile, i.e. where polygons are not present within a tile. I came up with this query but it takes a lot of time.
SELECT (st_dump(ST_DIFFERENCE(m.geom::geography::geometry,
ST_Union( ST_MakeValid(e.geom::geography::geometry))))).geom
    FROM tile m
    JOIN geom_table e on e.tile_id = m.feat_id
    WHERE  st_isvalidreason(e.geom) = 'Valid Geometry'
    GROUP BY e.tile_id, m.geom;

mainly because I think it is doing union of all geometries in a table. Could there be a better approach to it using PostGIS functions?


texts: Unable to add PostGIS table to Geoserver

texts:
I am able to add individual tables to Geoserver using,

curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d '<featureType><name>quadrella_indica</name></featureType>' http://localhost:8080/geoserver/rest/workspaces/opengeo/datastores/species/featuretypes

But I need to loop through the entire list of shp file and so,

for f in *.shp
   do
   a=${f,,};
   curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d    '<featureType><name>${a%.*}</name></featureType>' http://localhost:8080/geoserver/rest/workspaces/opengeo/datastores/species/featuretypes
done

Only returns a 400 Bad request error,

* About to connect() to localhost port 8080 (#0)
*   Trying ::1... connected
* Server auth using Basic with user 'admin'
> POST /geoserver/rest/workspaces/opengeo/datastores/species/featuretypes HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: */*
> Content-type: text/xml
> Content-Length: 47
>
* upload completely sent off: 47out of 47 bytes
< HTTP/1.1 400 Bad Request
< Server: Apache-Coyote/1.1
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Date: Sun, 25 Nov 2012 18:19:31 GMT
< Connection: close
<
* Closing connection #0
Trying to create new feature type inside the store, but no attributes were specified

The above error is repeated for all the shp files that are being added to geoserver. Any idea what is wrong?


texts: ArcGIS Spatial Join match options and merge rules

texts:
I'm having an issue with analysing data using the Spatial Join tool in ArcMap.
I have two data sets namely:

California Counties
Precinct Voting Data

I want to join these two sets so that I have the total_votes and total_yes_votes per county rather than per precinct.
I have set my Target Feature to "California Counties" and my Join Feature to "Precinct Voting Data" but I am still getting results way below the expected amounts. I suspect that it may be my Match Option which is incorrect (currently set to "INTERSECT") as some Precincts fall across two Counties or it may be that I have specified any Merge Rules as I'm not sure which feature classes I need to set Merge Rules for.
Could anyone advise me on how to move forward with this conundrum?


texts: Calculate distance from all points to all lines within 10km using FME?

texts:
I have a polyline shapefile and a point shapefile.  The points are along the polylines.  There are over 100 lines and over 10,000 points.  I want to calculate the perpendicular distance from every point to every line within 10km except for the line that the point is on.

I'm happy to calculate lines representing these distances.  My first thought was to use the NeighborFinder transformer.  However, this only seems to calculate the nearest line which is the line that the point is on (zero distance).

Sample image of data:

Is there a way to have the NeighborFinder find all of the closest lines within 10km?  How else can I accomplish this?  Perhaps a looper?


texts: Is it possible to add subscripts or superscripts into a legend?

texts:
I have a population density map where I'm showing the amount of people per square kilometer. In order to make it more visually appealing I want to show something like:

[any symbol here] - 2.00 - 5.00 people/km2 <--- where this 2 should be a superscript.

Is that possible in ArcMap? If so, how can I achieve this?


texts: Extracting road surface type from OSM files

texts: I'm trying to export all the road surface information (all countries) from OSM and create a layer on top of Mapbox. Is there a tool to download only the necessary information that I need? I could not find a good tutorial on this to start with.


texts:
*edited file links below

I'm working on several NGO projects at the moment, all of which are reliant on being able to use a district level map with some 490+ features, and I am running into some trouble with my geometries.

I spent most of the weekend trying to figure out how to snap the features together in this file (https://dl.dropbox.com/u/49434182/492%20Kabupaten%20Google%20Mercator.zip), to get rid of overlaps and slivers. Running the fTools validation tool, it tells me that I have more than 200 problems with this file. So, being a sensible person, I wanted GRASS to do the work for me. However, no matter how I tweaked the parameters of v.in.ogr, I couldn't eliminate the gaps or slivers when I went to export it again. GRASS would generate one layer of (basically) the geometries I wanted, and two layers of slivers.

I was able to get my hands on an official shapefile from the national statistics agency (found here: https://dl.dropbox.com/u/49434182/indokabkot_497_2010.zip), which although way more detailed, also has invalid/overlapping geometry according to fTools. I'm unsure of the right projection with this file, so that's also a bit of an issue.

I'm using QGIS 1.8, and am at a bit of a loss as to where I've gone wrong. Can anyone provide pointers before my data is due for a presentation next week?

Thanks!


texts:
I have files, in Tiff format, downloaded from ASTER-GDEM.

Can I open this file with QGIS? If yes, how?


texts:
I am comparing geometries of input layer and output layer features. I want to delete features in output layers which has equal geometry to input feature. I am using following code to do that.

for feat in drain.getFeatures():
    for f in outLayer.getFeatures():
        if feat.geometry().equals(f.geometry()):
            outLayer.dataProvider().deleteFeatures([f.id()])
            outLayer.updateFeature(f)

This code deletes features in output layer but while removing output layer from the Qgis desktop, input layer geometries disappears but features are there in attribute table.

What changes can I make in the code to make it work properly?
Here I am adding an image to make my doubt more clearer.

Here, "drain"is an input layer which is open in Qgis screen, it has attributes but features are not displayed(or visible) on the screen. It was coming correctly before executing the code given above.


texts: Checking if polygon fits inside another polygon using ArcGIS Desktop?

texts:
How do I check if one polygon fits inside another polygon? Furthermore how do I automatically check if one polygon fits in other polygons of my shapefile?

I have a shapefile with thousands of differnt polygons, each one listed in the attribution list with its own ID (they are singleparts, not multipart). The polygons have a non-regualar shape. Now, I want to check in which of those polygones fits one specific other polygone (it is a circle with a specific diametre). I only have a need for those polygones inside my shapefile in which this circle fits. Background (real world use): I am searching for (geothermal) sites at which I want to install a rig (with safety distances). So if there are areas where I can't place my drill rig incl. the safety distance I have no use for this area.

An idea was to have use the geometrical midpoint, overlay the circles and polygones midpoind and see if they edges overlay. Wrong idea since the geometrical midpoit is the wrong approch already. The polygons have very weird shapes, can be very long with a huge tip or whatever. Here the geometrical midpoint would be somewhere inside or even outside the long part of the polygone, the circle wouldn't fit, but at the tip it actually would fit.

Any idea how I can process automatically? Basically I just need to sort out those polygons in which my circle/other polygone doesn't fit. Don't care if the approch is for vector or raster (vector would be nice but I can always transform), for ArcGIS Desktop.

Illustration as below: In which polygons doesn't the circle fit?


texts: Using ArcGIS JavaScript to calculate length of line feature where clicked

texts:
I am working with arcgis JavaScript API and a linear referencing feature.
I want to be able to click on a line of a feature and calculate the length from beginning of the line to where I clicked. Then add this length with a number from a field in the feature.

I cannot find a module similar for this in the API. Should I use vanilla JavaScript for this or has someone done this using the arcgis JavaScript library.


texts: Which is the right version maven repository for geotools postgis?

texts:
The documentation seems to indicate that the right maven repository to use is:

  <repository>
     <id>osgeo</id>
     <name>Open Source Geospatial Foundation Repository</name>
     <url>http://download.osgeo.org/webdav/geotools/</url>
  </repository>

However, it seems that the latest version on this repository was last updated in 2014.
https://mvnrepository.com/artifact/org.geotools.jdbc/gt-jdbc-postgis?repo=osgeo

On the other hand, the Boundless one seems to be carrying a much more updated version than the other repositories. This one was last updated in September 2018:
https://mvnrepository.com/artifact/org.geotools.jdbc/gt-jdbc-postgis/20.0

However, the documentation states that the Boundless repository is for snapshots.

Which is the proper version to use?


texts:
I would like to display the value of a raster (at least one band) as a tooltip next to the mouse in Qgis.

The process would be :

I select the raster layer
when I move the cursor over the map (or maybe each time I click with the mouse),I can see the value next to the cursor.

I know the plugin ValueTool which is very useful for debug purposes but not so easy to use in order to analyse the data. It is often difficult to point at the right place with the mouse and at the same time to read the value in the plugin.


texts: How to fix Exception: forward transform failed with error: latitude or longitude exceeded limits

texts:
Export to vector file failed.

Error: Failed to transform a point while drawing a feature of type 'Dingalan_Brgy_Boundary'. Writing stopped. (Exception: forward transform of
(5731.78, 29676.2)

failed with error: latitude or longitude exceeded limits
)


texts: OpenLayers 3 : Tile layer not showing correctly

texts:
I am trying to use OpenLayers 3 to display tiles from a TMS repository.
I don't know why I only have some parts of may base layer displayed, north-west part as you can see:

Here is my code :

var NESource = new ol.source.XYZ({
      projection: 'EPSG:4326'
    , url: 'datatest/tms/NaturalEarthII/{z}/{x}/{-y}.jpg'
    , crossOrigin: 'null'
});

var NETileLayer = new ol.layer.Tile({
      source: NESource
    , isBaseLayer: true
    , wrapDateLine: false
    , extent: [-180.0, -90.0, 180.0, 90.0]
});
var map = new ol.Map({
    target: 'map',
    renderer: 'canvas',
    layers: [
          NETileLayer
    ],
    view: new ol.View({
          projection: 'EPSG:4326'
        , center: [0,0]
        , zoom: 1
        , extent: [-180.0, -90.0, 180.0, 90.0]
    })
  });

//Create the graticule component
var graticule = new ol.Graticule({
    map: map
  , strokeStyle: new ol.style.Stroke({
    color: 'rgba(255,120,0,0.9)',
    width: 2,
    lineDash: [0.5, 4]
  })
});

var extent = [-180.0, -90.0, 180.0, 90.0];
map.getView().fitExtent(extent, map.getSize());

Looking at Firefox console, I can see only those tiles (as said at the beginning) are requested, not all the extent.


texts:
I added pie charts via text-file to my map.

When printing the map they get lost. Does anyone know how to print them?
QGIS also seems to delet some charts, when there are to many at one place. Does anyone have a solution for that?


texts: Getting weird lines in Print Composer QGIS

texts:
I am working with QGis 2.8 and want to use the print composer to create a jpg image.
I used this PlugIn (https://github.com/jdugge/ClipToHemisphere) to create the globe.

The graticules I created the following.

Set Projection of Project to WGS 84
Open World Map Layer which was not processed by the Plug In (I tried it with the processed one as well, that did not change the outcome)
Create a VectorGird with the extend of World Layer loaded in step 1
Densify the Geometry

That left me with a nice grid.

Then I went into the projects properties and set the projection to my custom CRS which is centered in Afghanistan. In the Rendering properties I had to unselect "Simplify Geometry" (for all my layers, not just the grid layer).
I open the Print Composer and all looks good. But when I save the created globa as an image, there are lines which I did not see before. I have no idea where they are coming from...

Thats how it looks in the print composer.

Thats how the exported image looks like.

Any thoughts on this?


texts: How To Make My Map Fit the Whole Screen in Layout view

texts:
This is my page and print setup

This is my layout view

I want to make my layout view bigger. How can I expand it to the full extent. Sorry if this seems like a stupid question but I've tried everything and it doesn't work.


texts: Extracting POI from Openstreetmap (*.osm)

texts:
I've searched the web and found out that "osmosis" is the key.
also, this blog http://learnosm.org/en/osm-data/osmosis/ gave me a huge hint and i made it to extract POI tag by tag
(by the way, i am using windwos)

as you know, there are hundreds of tags in OSM and going through all the tags and paste that in the command window is not feasible.
so, instead of writing "amenity.school", i used "amenity.*"

of course, it doesn't seem to work.
You have any suggestions?


texts:
I'm trying to change raster layer with a selector.

I don't understand why the clear method don't work on tileWMS however it's on the API doc...

For a vector source, on an other app, it work :

var cqlFilter = 'date_debut BETWEEN 1000 AND 2000 OR date_fin BETWEEN 1000 AND 2000';
var urlTemplate = 'http://serveradress/geoserver/applications/wfs?service=WFS&' +
'version=1.0.0&request=GetFeature&' +
'typeNames=applications:patrimoine&' +
'CQL_FILTER=' + cqlFilter +
'&outputFormat=application/json&' +
'srsName=EPSG:4326';
console.log(urlTemplate);
var _vectorSource = new ol.source.Vector({
  format: new ol.format.GeoJSON(),
  url: function() {return urlTemplate;}
});

function changeDate(years) {
  var dateMin = years[0];
  var dateMax = years[1];
  var cqlNewFilter = '(date_debut BETWEEN '+ dateMin + ' AND ' + dateMax + ' OR date_fin BETWEEN ' + dateMin + ' AND ' + dateMax + ')';
  urlTemplate = 'http://serveradress/geoserver/applications/wfs?service=WFS&' +
  'version=1.0.0&request=GetFeature&' +
  'typeNames=applications:patrimoine&' +
  'CQL_FILTER=' + cqlNewFilter +
  '&outputFormat=application/json&' +
  'srsName=EPSG:4326';
  _vectorSource.clear(true);
  _vectorSource.refresh();
};

var _cluster = new ol.source.Cluster({
    distance: 50,
    source: _vectorSource
});

var _layer = new ol.layer.Vector({
  source: _cluster,
  style: _patrimoineStyle
});

But whith a TileWMS layer it don't work, it tells me that _rasterSource.clear is not a function :

var anneeCouche = "2016_20cm";

var _rasterSource = new ol.source.TileWMS({
  url: 'http://serveradress/geoserver/raster/wms?',
  params: {LAYERS: 'raster:ortho'+anneeCouche}
});

function changeDate(annee) {
  if (annee === '2013') {
    var anneeCouche = "2013_20cm";
  } else {
    var anneeCouche = "2016_20cm";
  };
  _rasterSource.clear(true);
  _rasterSource.refresh();
};

var _layer = new ol.layer.Tile({
  title: 'Ortho',
  source: _rasterSource
});


texts:
I created a map package on my desktop, and copied the folder containing it and a geodatabase containing feature classes that were in the map to my laptop. On my laptop version, I edited one of the feature classes. When I copied my laptop version of the map package back to my desktop (to a different folder than the original) and opened it, it did not show the edited version of my feature class, but rather the original feature class. I assumed that the edits I made were being made to the geodatabase that I copied to the laptop and that the map package would have referenced that. But it did not. Apparently, when you make a map package, it packages up all files, whether or not you 'pack' them with it in the folder you're transferring to another computer.

Is it not good practice to use a map package as a working copy, when editing features?

Should I have saved a copy of the map package as an .mxd, then packaged that before transferring it back to my desktop?

How could I have avoided this problem?


texts: How do I make a polygon from LineString?

texts:
I am trying to create a polygon using Lat/long's of community districts. Here is my query below:

SELECT ST_MakePolygon(ST_GeomFromText(
'LINESTRING (40.665535 -73.9933, 40.665535 -73.969749, 40.7245 73.9419, 40.6773 74.0094,40.6795 73.9992, 40.6733 -73.9903, 40.7081  -73.9571, 40.6872 -73.9418, 40.6849 -73.9845, 40.665535 -73.9933)'), 4326);

Whenever I try to run this query I get an error message:

HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Can someone guide me in the right direction?


texts: I'm attempting to install QGIS version 2.18.6 (64-bit).  The installation gets close to completion, but before it finishes I get a message saying "Extract error writing to file..." I've tried installing several times, and a different file name comes up in the error message almost everytime (including qtgui4.dll, gdal200.dll, and others).  Per another user's suggestion, I opened a command window and looked at the tasklist, but nothing comes up.  I'm running as an admin and installing to the default program files (C:/Program Files).  Any suggestions?


texts:
I have used v.transform for affine transformation and it works OK in terms of rotating and scaling (I do one step at the time), however, it always displaces the shapefile.

For example, for the shapefile below I have rotation specified and the other values remain default. The output transformed is rotated as expected by is shifted geographically. It seems that it is rotation from (0,0) of the start of the coordinates.

I could not find the place where to specify the point of rotation.


texts: Exporting point shapefile from ArcGIS for Desktop to R?

texts:
I am having several problems in exporting my point shapefile from ArcGIS 10 to R.

I tried to save the shapefile as a CSV, but R reads all in one row; somebody in another question answered to use GDAL: I don't know where to find GDAL and furthermore my R version does not have this package; I tried to save it as a .txt but it says "an error occurred exporting the table".. I am out of ideas, nothing seems to work.

Can anybody give me a little help?


texts: Export a georeferenced `QGIS` raster for use as `OSMAnd` overlay?

texts:
I have a couple .jpeg files of few hundred megabytes each along their .prj projections and .wld world files – i.e. some georeferenced raster from what I read — and wish to import them for use with OSMAnd as overlays. This is a follow-up of a previous question I asked:

How to import a .jpeg, .prj and .wld triplet as a raster layer in qgis?

I now have a proper georeferenced raster imported into qgis and it seems that I can export (via Save As with a right-click on the layer) tiles as georeferenced .tiff but not .mbtiles as I get a cannot find min and max_zoom_level. Note that I tried to pick a EPSG:3857 projection for .mbtiles as using the EPSG:4326 was getting me an error.

I'm wondering how to import them inside OSMAnd. I've found that OSMAnd use .obf files for offline maps and/or may also use a .sqlite database. It seems that I may have to do a conversion but I'm not sure how to use the output file, nor how to generate an .obf file.

Thus, to sum up:

How to export a qgis raster layer for use as an overlay or underlay inside osmand?


texts: Calculating distance between two points using ArcPy

texts:
I have 4 coordinates on map.
lat1 = radians(47.434756)
lon1 = radians(42.971468)
lat2 = radians(47.542419)
lon2 = radians(42.946061)

I want calculate distance between this.
from math import sin, cos, sqrt, atan2, radians
R = 6373.0

lat1 = radians(47.434756)
lon1 = radians(42.971468)
lat2 = radians(47.542419)
lon2 = radians(42.946061)

dlon = lon2 - lon1
dlat = lat2 - lat1

a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2
c = 2 * atan2(sqrt(a), sqrt(1 - a))

distance = R * c/100

print("Result:", distance)

My code say that distance is 0.1212.
ArcGIS says 0,11062 (shape length).
But when I measured with a ruler - its shows 9.23km.
How do I correctly calculate distance with ArcPy?


texts: how to create WFS from feature class, do i have to have Arcgis Server or is it possible throw Arcgis Online ? (Version 10.3)


texts: Displaying tiles generated by gdal2tiles with OpenLayers?

texts:
I'm currently facing issues displaying tiles generated with gdal2tiles.py in OpenLayers 4.5.6

My geotiff is issued from SHOM catalog.

To generate the tiles, I had to translate my tif to vrt to be a RGB/RGBA compatible file.

gdal_translate -of vrt map.tif map_translated.vrt

then i've simply run

gdal2tiles.py map_translated.vrt

and issued a tile map source file like the following

<TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
  <Title>temp.vrt</Title>
  <Abstract></Abstract>
  <SRS>EPSG:3857</SRS>
  <BoundingBox minx="-3.92503169515670" miny="46.43569348844158" maxx="-1.42506635394127" maxy="47.66245305306844"/>
  <Origin x="-3.92503169515670" y="46.43569348844158"/>
  <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
  <TileSets profile="mercator">
    <TileSet href="7" units-per-pixel="1222.99245234375007" order="7"/>
    <TileSet href="8" units-per-pixel="611.49622617187504" order="8"/>
    <TileSet href="9" units-per-pixel="305.74811308593752" order="9"/>
    <TileSet href="10" units-per-pixel="152.87405654296876" order="10"/>
    <TileSet href="11" units-per-pixel="76.43702827148438" order="11"/>
    <TileSet href="12" units-per-pixel="38.21851413574219" order="12"/>
  </TileSets>
</TileMap>

All samples produced from gdal2tiles are working fine, but i'm trying to integrate tiles to openlayers 4.5.6 with the following code :

var mapMinZoom = 7;
var mapMaxZoom = 12;

var mapExtent = [-3.92503169516, 46.4356934884, -1.42506635394, 47.6624530531];
var defaultExtent = ol.proj.transformExtent(mapExtent, 'EPSG:4326', 'EPSG:3857');

var mapCenter = [-2.5461600, 47.3793800];
var defaultCenter = ol.proj.fromLonLat(mapCenter);

var osm = new ol.layer.Tile({
  source: new ol.source.OSM()
});

var xyz = new ol.layer.Tile({
  extent: defaultExtent,
  source: new ol.source.XYZ({
    projection: 'EPSG:3857',
    attributions: 'Tiles © SHOM, rendered with ' +
        'Shom',
    url: './data/maps/7068/temp/{z}/{x}/{y}.png',
    tilePixelRatio: 2,
    minZoom: mapMinZoom,
    maxZoom: mapMaxZoom
  })
});

var view = new ol.View({
  center: defaultCenter,
  zoom: 12
});

var map = new ol.Map({
  target: 'map',
  layers: [ osm, xyz ],
  view: view
});

Unfortunatly the map can't find corresponding tiles into the generated tiles folder. Ex :

./data/maps/7068/temp/12/2019/1434.png

Thing is the zoom and x are fine, but y is not right, my tiles folder got 2xxx.png tiles instead.

I might be missing something about Extent or Translation, should I translate my tiff differently ?

generate my tiles differently ?

Adjust settings on the map ?


texts: Looking for information on methods or algorithms used to calculate centroid from polygons across software

texts:
Looking for information on methods or algorithms used to calculate point centroids from polygons across software.

ArcGIS uses a "gravity model" but can someone point me to the math or a paper on the method? This is the best info I can see for Arc but it is not detailed enough.

QGIS uses ???

WhiteBox uses ???

R uses ??

GDAL / OGR uses ??

Grass uses ??

I am not looking for code unless it helps define the algorithm or method utilized.
Really looking for citable literature.

For example, for flow direction ArcGIS uses the D8 algorithm and this is based on

Greenlee, D. D. 1987. "Raster and Vector Processing for Scanned Linework." Photogrammetric Engineering and Remote Sensing 53 (10): 1383–1387.

Jenson, S. K., and J. O. Domingue. 1988. "Extracting Topographic Structure from Digital Elevation Data for Geographic Information System Analysis." Photogrammetric Engineering and Remote Sensing 54 (11): 1593–1600.

Looking for similar for centroids. I can use the n vertices method myself in code but want to find out what others use.


texts: I see that people have suggested this post correction equation ((b1 le 0)*0+(b1 ge 10000)*1+(b1 gt 0 and b1 lt 10000)*float(b1)/10000) for atmospheric correction using FLAASH (where surface reflectance values are not within the normal range. Just curious to know if there is any reference to back this up in case one wants to publish such result in a journal.


texts: What are good colour schemes for large density flow maps?

texts:
I came across nice QGIS tutorial for mapping flows.

In contrast to Alasdair, I have zero talent in colour choice. Can anybody recommend some good starting points for nice colour schemes (I'd be interested in both 'dark' and 'light' background options) that work nicely on screen and in print?


texts: How to iterate in a Spatial Polygon Data Frame in R?

texts:
I'm trying to iterate in a SpatialPolygonDataFrame that contains 110 features.

I tried to use the following code with no success:

iterate.spdf = function(x){
    for(i in 1:nrow(x)){
        p = x[i,]
    }
    return(p)
}

It returns with a SpatialPolygonDataFrame that contains only one feature. The code seems to overwrite the polygons to end up with only one feature.

Any suggestions?


texts:
Just installed  QGIS 1.8. on Mac OSX

Installed GSL
Install GDAL 1.9 Complete
Installed QGIS

keep getting this console error message in QGIS.

Failed to load /Applications/QGIS.app/Contents/MacOS/../PlugIns/qgis/libgrassrasterprovider.so (Reason: Cannot load library /Applications/QGIS.app/Contents/MacOS/../PlugIns/qgis/libgrassrasterprovider.so: (dlopen(/Applications/QGIS.app/Contents/MacOS/../PlugIns/qgis/libgrassrasterprovider.so, 5): Library not loaded: /Applications/GRASS-6.4.app/Contents/MacOS/lib/libgrass_gis.6.4.2.dylib
  Referenced from: /Applications/QGIS.app/Contents/PlugIns/qgis/libgrassrasterprovider.so
  Reason: image not found))

and

Couldn't import Python module 'psycopg2' for communication with PostgreSQL database. Without it you won't be able to run PostGIS manager.

when i try and use the postGIS admin tool

Anyone know how i can fix this..


texts: I have created a QGIS project template file and gone through the style manager to create all my necessary styles I would like in my template; but when another user uses 'New from template' they still need to import the styles - is there a way to include the styles within the template to save a step?


texts:
I'm trying to run this query:

SELECT round(ST_Distance_Sphere(
    ((ST_GeomFromText('POINT(:lat :lon)',4326))),
    (SELECT wkb_geometry FROM coastline ORDER BY wkb_geometry <->
    ((ST_GeomFromText('POINT(:lat :lon)',4326))) LIMIT 1 )
    ))
as Distance;

As you can see, I'm trying to use named placeholders on it, but I get this error:

Warning: PDOStatement::bindParam(): SQLSTATE[HY093]: Invalid parameter number: :lat
Warning: PDOStatement::bindParam(): SQLSTATE[HY093]: Invalid parameter number: :lon

I tried not repeating the placeholders (using lat, lat2, lon and lon2, just in case), using half named placeholders and half fixed numbers. Neither of them worked. Instead, I tried it like this:

ST_GeomFromText('POINT(".$lat." ".$lon.")',4326)

And it works, but I want to use named placeholders. Does someone know which kind of dark magic is preventing me from doing so?

I don't know if that would be better on stackoverflow, but since I'm having this problem only with postgis, I thought it might be better to ask here.


texts: QGIS categorized legend show only with data

texts:
I generate maps from CSV to which I apply a style sheet.

In the stylesheet defines the set of items I may encounter.

But in most csv, there are not all the elements defined in style.

So I find myself with times 10 points of the same type on the map, but with a legend of 50 categories.

How to display the categories that are present on the


texts: Should the geometry column always be the last column of a postgis table?

texts: When we need to add an attribute to a table (e.g. a table of 350,000 polygons), my instinct is to always recreate the table so that the geometry column is last.  I think this is a best practice for optimal performance, but I can't find any source to back this up.  All imported shapefiles have the geometry column last, but I don't know if this is for performance reasons or not.  I believe column order is important for some database platforms, but I'm not sure it is for PostgreSQL.  Does anyone have an opinion?


texts: Arcpy creating Polyline from dictionary values

texts:
I am attempting to do the final project for the open source Penn state class https://www.e-education.psu.edu/geog485/node/144. The task is to parse a CSV file containing rhino coordinates and create a polyline.
I have written code that I believe should work but nothing gets created in the feature class
import csv
import arcpy
arcpy.env.overwriteOutput = True
file = 'C:\RhinoObservations.csv'
geodb = "C:\rhinotracks.gdb"
earthq = arcpy.CreateFeatureclass_management(geodb,"Rhino","POLYLINE",'','',"ENABLED",4326)
arcpy.AddField_management(earthq,"NAME","TEXT")
rhino = {}
with open(file, 'rb') as csvv:
    reader = csv.DictReader(csvv)
    for row in reader:
        if row['Rhino'] not in rhino:
            rhino[row['Rhino']] = []
        rhino[row['Rhino']].append((float(row['X']),float(row['Y'])))
with arcpy.da.InsertCursor(earthq,("NAME","SHAPE@XY")) as cur:
    for k,v in rhino.items():
        print k,v
        array = arcpy.Array()
        for coords in v:
            array.add(arcpy.Point(float(coords[0]),float(coords[1])))
        line = arcpy.Polyline(array,4326)
        row2 = (k,line)
        cur.insertRow(row2)

the script throws no error and create a feature class of the rhinos names but there are no polylines

I am using this post as a reference Creating arrays and polylines from dictionary using ArcPy?
when I print k,v the rhinos name has the correct XY pairs stored in their correct tuples. I do not know why there is no polyline showing up
this is the output for the Rhino Meredith when I print k,v. Tuple in a list
Meredith [(26.97808, -19.11016), (26.97768, -19.11153), (26.97551, -19.11269), (26.97657, -19.11343), (26.97607, -19.11448), (26.97434, -19.11438), (26.97311, -19.11301), (26.97378, -19.11269), (26.97412, -19.11175), (26.97479, -19.11085)]


texts: Switching data source of layer to new feature class using ArcPy with ArcGIS Pro 2.0?

texts:
A common ArcPy coding pattern that I used with ArcGIS Pro 1.4 (and earlier) no longer works at ArcGIS Pro 2.0.

I have an ArcGIS Pro project with one map called Map, and that map has one layer called Test Layer.  Test Layer has as its data source a file geodatabase feature class called testFC.

I have used the Select tool to create a new feature class called testFC2 which is a subset of testFC (so it has an identical schema).

In ArcPy at ArcGIS Pro 1.4 I had no trouble switching the data source of Test Layer from testFC to testFC2 in the same file geodatabase using this code:

import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\temp\test.aprx")
mapx = aprx.listMaps("Map")[0]
lyr = mapx.listLayers("Test Layer")[0]
lyr.dataSource = r"C:\temp\test.gdb\testFC2"

However, the same code at ArcGIS Pro 2.0 gives:

  AttributeError: can't set attribute

I checked the help for the Layer class and that now says that the dataSource property is now Read Only whereas previously it was Read and Write.

The same help page says:

  Changing a layer's data source is a common requirement. There is a
  method and a property on the Layer object that help with this. For a
  more detailed discussion, parameter information, scenarios, and code
  samples, please refer to the Updating and fixing data sources
  help topic.

I can find no suitable code sample to use in place of my coding pattern at Updating and fixing data sources which seems to be focussed on switching workspaces of data sources.

How do we switch the data source of a layer to a new feature class using ArcPy with ArcGIS Pro 2.0?

The same issue seems to have been noted at GeoNet where Marco Boeringa says:

  The "dataSource" property of the Layer class also seems to have become
  Read Only. However, you can use the "updateConnectionProperties" on
  the same class to solve this

However, I think his situation must have been slightly different because I cannot see how updateConnectionProperties can be used to answer my question above.


texts: Animate points and/or polygons on leaflet map

texts:
I am working with leaflet. I am wondering, if it is possible to animate points on the leaflet map like cartoDB is doing it with torque.js.
I basically need a timeslider for manual display and a play-button for automatic display of the data. I cannot use torque.js because my data depends on the user input and may change during a session various times. Uploading it to cartoDB is therefore no option. I am aware that there is the possibility to create torque-tiles from a postGIS database. But: loading the data which the user requests into a postGIS database, running the .py from cartoDB to create torque-tiles on it and then feeding it to the torque framework sounds hacky.

I am further interested in applying the solution - if possible - to polygons. I need to change a choropleth map over time.


texts: Dynamically change zoom level of overview map to fit with current extent in DDP

texts:
I am using DDP pages in a large mapset with pages ranging from 1:7500 to 1:130,000 and the overview map is zoomed out to far to see some of the smaller zones. Is it possible to set the overview map to zoom to say 10 times the current DDP page extent? so a 50k main sheet would have the overview at 500k.

Map overview scale @ 1:3,000,000 - meaningless as it is to full of info.

Map overview scale @ 1:500,000

So we can use the cartography-->ddp-->calculate adjacent fields to get the adjoining map sheets but this doesn't seem to help in changing the zoom levels of the map.

Till now my workaround has been to create multiple mxd's which have all the maps in an overview zone that makes sense but this causes issues when making edits to pages etc etc and it would be ideal to automate it into one mxd.

Also is it possible to get DDP to fill in the total number of maps -this should be map 14 of 38 but the 13 is carried over from a previous version as it's hard coded.

I also found another workaround. In the overview map data frame properties, go to Data Frame tab and choose options as per the screen capture below.

This seems to work fine as long as the extents don't change to much.


texts: Render vector tiles to PNG on Android & iOS

texts:
I have an Android + iOS app using Google Maps SDKs to display a map, and I'm in the process of setting up an OSM tile server.

I'm evaluating the possibility to use vector tiles instead of raster, but replacing Google Maps SDK isn't an option.

So, I'd like to know if it's possible to render a vector tile on Android & iOS to an image? Would Mapbox GL native C++ SDK allow me to do that with .mvt tiles? If not, is there another option?


texts: Open Python Script with pythonaddins.GPToolDialog from Addin Wizard

texts:
I created a addin from python addin wizard with many menus and buttons. For one of these buttons I want to open a Python (.py) script from my Toolbox. I tried many ways but no one works. I want this because this script open the parameter dialog box with some parameters to input. I really need to open the windows to put the parameters.

class ConfereChave(object):
    """Implementation for ConfereChave.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.MessageBox('Text', 'Confere Chave', 0)
        relPath = os.path.dirname(r'F:')
        TBX = relPath + r"\Agro\Agro.tbx"
        pythonaddins.GPToolDialog(r'F:\Agro\Agro.tbx', 'ConfereChave')

I get this error:

Executing: ConfereChave F:\AgroBD.gdb\IBGE\Brasil_Municipios Alfabetico
COD_IBGE teste1 Float
Start Time: Fri Jul 21 00:31:52 2017
ERROR 000576: Script associated with this tool does not exist.
Failed to execute (ConfereChave).
Failed at Fri Jul 21 00:31:53 2017 (Elapsed Time: 0,69 seconds)

I already put the relative path but do not work too.

Code updated but do not work, the same error remains.Remember CampoConfere is a python script (py)


texts: Is it possible to send my current location on iPhone or Android to the server so that others can view my current location?


texts: Using a geotagged jpg in the WGS coordinate system

texts:
I am working on software for mapping purposes and ran into a projection issue that is beyond my knowledge of GIS.

The software utilizes longitude latitude for all visual mapping in order to maintain consistency among all locations. This has worked great until I started to work with world files.

I have a world file that was exported in ArcMap using a UTM Zone 13N projection that looks like this:

Now I would like to add this image to the mapping software as a background (which is in WGS) so a projection conversion is necessary. After determining the image extent and location of the world file, then converting those points to WGS, I get the resulting extent defined by the rectangle:

Unfortunately, there is a slight tilt to the location where the jpg should be. Performing a transformation to the jpg is not trivial which leads me to the question:

Is there such a thing as having a world file that is compatible with the WGS coordinate system or are they only compatible with projected systems?

If they CAN be used in a geographical system, is there any easy way to handle the transformation (as opposed to pixel by pixel)?


texts: QGIS date fields widget - unable to select todays date?

texts:
This is something that I have lived with for several months as there is an easy workaround, but I thought I'd see if anyone knows of a solution, or whether it is a bug.

In Layer Properties > Fields I have set up a date field widget as in the screenshot;

It is set to have a 'Calendar popup'.

It is also set to 'Allow NULL values'. The dataset we are using is based upon polygons that have associated NULL dates. The date is added as and when the polygon has had some sort of involvement by the users.

When in layer edit mode to enter a date, the pop up calendar appears with todays date highlighted. However it is not possible to select todays date.

It is possible to select any other date, and then, after that, it is possible to select today's date.

Is there something that can be done to enable selecting todays date first time, or is this a bug, or shall I just not worry and live with it as it's not a big deal?

[When editing a polygon, without the 'Allow NULL values' field selected, the date is prepopulated with today's date; others dates are selectable.
However, as the setting suggests it is not then possible to go back on the entry of a date and enter NULL. The users do need this option, as sometimes when working with 130,000+ polygons they edit the wrong polygon and need to undo their edit.]


texts: Determining True North from drone footage?

texts: I recently surveyed a site using a drone (not my own). I have composited together roughly 20 images to form an overall image of the site; however, this composited image contains no metadata pertaining to coordinate location. I am trying to find a way to determine True North based on the images I have put together. I'm guessing that there is a way to do this in QGIS; however, I'm not sure how without accurate metadata.


texts: What is the differnece between string(75) and text as field types in qgis? how is it going to affect when I try to join them?

texts:
I have been trying to join a table(250320) with a layer (IND_admn1) in qgis and it worked once(with another table-230320), but second time onwards it has been showing an error such that the join layer has null values. The join field is of type text while the target layer of type string. The same could be joined once but not again..why is it so? I tried using field calculator to create a new field of type string to solve the problem but again no use. Tried joining two integer fields but one is integer while other is integer(64 bit).
State/UT is of type string, so is Name of State/ UT.
Pls help!


texts: Mapbender: failed to load WMS-layer / target elements not defined

texts:
After creating a WMS (WMS 1.3.0) in Geoserver (2.15.1) I cannot load the WMS service in Mapbender (v. 3.0.8.1).
Original WMS-URL:
http://localhost:8082/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities
In Geoserver all of the layers are displayed correctly. The WMS-layers can also be loaded properly in QGIS (WMS-layer).
For the app configuration I have followed the instructions from the Mapbender documentation. Independently on the chosen source in the layersets of the app the WMS cannot be loaded. I also get the errors: "element: a target element is not defined" although I have defined those elements:

I also tried to choose other sources which are already available from the source list in Mapbender but got the same errors. I am running both Geoserver and Mapbender on the OsGeoLive13 virtual machine (virtual box). Can someone tell me why the WMS-layers cannot be loaded or why do I see just an empty screen? I simply cannot load any WMS layer in Mapbender but have followed all steps in Mapbender docu. A problem with the getCapabilities document could be the clue. Thank you in advance for your help!


texts: Convert surveyor's calls in excel table to polygon shapefile

texts: Do you know of a way to take surveyor's calls from an excel file (for example: N35-45-15W 60.0 ft, etc) and have them generate polygon shapefiles point by point in GIS? I know you can easily do this with point features that have coordinates, but I am trying to figure out how to build full polygons (without XY coordinate information, just surveyor's calls).


texts: Making Shapefile Hybrid Micro-Plot Boundary?

texts:
We would like to analyze in the field of precision agriculture the performance of a lot of hybrids that are planted in lines with no border between them. For this we need to make boundary or a border for each hybrid when the plants are in their early stages so we can use this border template to detect the exact location of hybrids later on.

For this we've made an ortophotoplan (RGB) that has <1cm accuracy and defined polygon shapefiles in QGIS that we've exported as shapefile and then imported in Pix4D Mapper (Desktop) in the Index branch, but the drawn boundaries are shifted from the place they where in QGIS (or to the left or to the right).

Do you know what we could have done wrong?

Or is there another way to make boundaries that we can use?

The purpose of the boundaries is to be imported later on when the plants are developed and you can no longer distinguish where one hybrid starts and where it ends so we can be sure we're indeed analyzing the right hybrid and not stepping in the area of the next one (because the area covered by one hybrid is very small and there are maybe a few dozens types crammed into a single space with no visual border between them).

I want to mention that all the maps used to make the boundaries are cm level accurate and that we would like to import the boundaries to different maps that are cm level accurate (rgb ortophotoplans, multispectral maps, thermal maps).

Can you please help us figure out how to make the boundaries fall into the right place accurately across all types of maps?