texts: KeyError: 'visual' while downloading the subarea from Planet Labs?

texts:
I've trying to download an AOI from planet using this same example. Planet Example Link

My code is ditto. I keep getting this error.

  KeyError: 'visual'.

I did activate the scene containing the subarea, number of times.
My code if it helps.

subarea.geojson

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type":"Polygon",
        "coordinates":[
          [
             [
                -114.176423930378903,
                32.691933554346988
             ],
             [
                -114.176423930378903,
                32.685249521402788
             ],
             [
                -114.168019741897595,
                32.685249521402788
             ],
             [
                -114.168019741897595,
                32.691933554346988
             ],
             [
                -114.176423930378903,
                32.691933554346988
             ]
          ]
        ]
      }
    }
  ]
}

download_aoi.py

    from osgeo import gdal
    from requests.auth import HTTPBasicAuth
    import os
    import requests

    PLANET_API_KEY = 'xxxxxxxxx'
    item_id = "20161109_173041_0e0e"
    item_type = "PSScene3Band"
    asset_type = "visual"
    item_url = 'https://api.planet.com/data/v1/item-types/{}/items/{}/assets'.format(item_type, item_id)

    # Request a new download URL
    result = requests.get(item_url, auth=HTTPBasicAuth(PLANET_API_KEY, ''))
    download_url = result.json()[asset_type]['location']

    vsicurl_url = '/vsicurl/' + download_url
    output_file = item_id + '_subarea.tif'

    # GDAL Warp crops the image by our AOI, and saves it
    gdal.Warp(output_file, vsicurl_url, dstSRS = 'EPSG:4326', cutlineDSName = 'subarea.geojson', cropToCutline = True)

Error:Traceback (most recent call last):
File "download_aoi.py", line 14, in
download_url = result.json()[asset_type]['location']
KeyError: 'visual'


texts: QGIS Python Dialog Box for Zooming into coordinates

texts:
qid = QInputDialog()
title = "Enter Coordinates"
label = "X:"
mode = QLineEdit.Normal
text, ok = QInputDialog.getText(qid, title, label, mode)
print text

I am trying to create a dialog box in which I can zoom into specific coordinates. However, I'm not sure on how to get both X and the Y coordinates. The picture below shows only X.


texts: Making circle onClick of mouse using OpenLayers 2?

texts:
I am new in Openlayer2 . I want to make a circle on click but my code making a marker and a random generated circle.

You can check on code here  https://fiddle.jshell.net/sm1g1hxz/

<!DOCTYPE html>

    <meta charset='utf-8' />


texts:
I have a test point table that created via ArcMap create feature class tool. And I am using ArcGIS 10.5 and PostgreSQL 9.5 database. I am using PG_GEOMETRY.

I want to insert a sample point using sql query.

insert into
      sde.test
values(
      sde.next_rowid('sde', 'test'),
      'sample',
      st_asbinary(ST_Point('POINT (52 24)', 4326))
);

but this query inserted a NULL geometry in my test table.

To insert data using an SQL query, should I update any other tables after the insert?

I have selected table info like this:

SELECT table_schema ,column_name ,data_type ,udt_schema ,udt_name ,numeric_precision ,numeric_precision_radix ,numeric_scale ,character_maximum_length FROM information_schema.columns WHERE table_name = 'test';


texts: GeoExt: Turning off layer title in legend

texts:
I am using GeoExt for my web mapping project. My web map includes a legend generated by GeoExt. Is it possible to turn off the layer title for a specific layer in legend? I am aware that there is a showTitle property for GeoExt.WMSLegend. However setting this property to false will turn off the layer titles of all the layers in the legend. Is there any way to turn off the layer title of just one single layer?

// Add a legend panel
legendPanel = new GeoExt.LegendPanel({
    map: map,
    title: 'Legend Panel',
    renderTo:'description',
    border: false,
    autoScroll: true,
    defaults: {
        showTitle: false,
        style: 'padding:5px',
        baseParams: {
            FORMAT: 'image/png',
            LEGEND_OPTIONS: 'forceLabels:on;fontName=Verdana;fontSize:11'
        }
    }
});


texts: Publishing map services in ArcMap gives ERROR 001487: Failed to update published service with server-side data location?

texts:
I am using the python script provided by arc help to publish map services but keep getting this error. I am using desktop ver 10.3 and publishing to arc server 10.1. Different version isn't a problem. I looked into that already. Here's what I'm getting..

Executing: StageService //gis/noble/Region/GulfOfMexico/MAPS/Rusty/PTRL_GOM_GBDS1.sddraft \\gis\noble\Region\GulfOfMexico\MAPS\Rusty\PTRL_GOM_GBDS1.sd
Start Time: Wed Jul 27 12:58:45 2016
Submitted.
Executing...
Start Time: Wed Jul 27 12:58:57 2016
Succeeded at Wed Jul 27 12:58:58 2016 (Elapsed Time: 0.33 seconds)
Succeeded.
Succeeded at Wed Jul 27 12:58:58 2016 (Elapsed Time: 13.03 seconds)
Executing: UploadServiceDefinition //gis/noble/Region/GulfOfMexico/MAPS/Rusty/PTRL_GOM_GBDS1.sd "GIS Servers\arcgis on hougsagis01.gs.nblenergy.com_6080 (publisher).ags" # # FROM_SERVICE_DEFINITION # STARTED USE_DEFINITION NO_SHARE_ONLINE PRIVATE NO_SHARE_ORGANIZATION #
Start Time: Wed Jul 27 12:59:10 2016
Submitted.
Executing...
Executing (Publish Service Definition): PublishServiceDefinition i24681d7c-eb34-40ef-8223-32f7fc1c7e34 # {"buildInitialCache":false} #
Start Time: Wed Jul 27 12:59:13 2016
Validating publish options.
Connecting to the server.
Getting basic item metadata for service definition upload.
Getting server information (server folders, data stores, etc.).
Extracting manifiest from uploaded service definition.
Deriving arcgis server service from hosted service (hosted service definition).
Validating service definition.
Determining service's input folder name.
Attempt to find service's input folder.
Creating the service.
ERROR 001487: Failed to update the published service with the server-side data location. Please see the server's log for more details.
ERROR 001369: Failed to create the service.
Failed to execute (Publish Service Definition).
Failed at Wed Jul 27 12:59:14 2016 (Elapsed Time: 0.92 seconds)
Failed.
ERROR: the server's publishing job didn't succeed.
Failed to execute (UploadServiceDefinition).
Failed at Wed Jul 27 12:59:13 2016 (Elapsed Time: 3.01 seconds)

I cannot access the server folders past  Directory /opt/ags/arcgis/server/usr: permission denied. I cannot access the logs. Has anyone else run into this?


texts: Are there any open source mapping APIs/toolkits for drawing axes,labels,graticules etc?

texts:
I tried to post a more generic question to meta, but it's my first question, so I didn't have a reputation yet.

The first question I have is whether this is an appropriate place to ask questions about the availability of software "components"--APIs or toolkits for mapping and geographic/geodetic functions.

If this is the appropriate place:  I would very much like to find an open source mapping API, using either OpenGL or one of the QT graphics APIs like QPaint--something that draws and labels axes and graticules, scales, etc--if it had geographic entry points (lat, long) so much the better.  Map underlays would be wonderful.

I have not been able to find anything despite repeated searches, so have written a good deal of my own, using C++/QT/OpenGL.  But I find I am spending as much time on my infrastructure as I am on my application, and I'd like to get out of that situation if possible.

My application is typically real-time plotting of positions of underwater vehicles and associated data.


texts: Using model precessing save from qgis into qgis python plugin

texts: I would like to know if there is anyway to load from a QGIS python script a .model file and run it through the processing.runalg method as it seems that we lost the capability to save our model as a python file.


texts: Is there any tool in QGIS to select and translate an inner ring without altering it nor the rest of the polygon?

texts:
I want to highlight the cloudfree pixels of a satellite image of which both of it with the cloudmask had been imported and reprojected from another GIS software.

Because of the reprojection, my cloudfree layer presents a small shift from the reprojected satellite image. The boundaries of my polygons are almost good but more importantly I have to correct the location of the clouds.

Advanced digitizing\Node Tool allows to select and apply a translation to the nodes of an inner ring but only through the use of a square-shaped selection tool. Oftentimes my clouds are so tightly close together and complexe that I cannot only select a single cloud with that tool (see picture below).

Anyone knows a way to easily just select all the nodes of an inner ring in QGIS?


texts: Assigning/joining tabulated data to features in MapInfo?

texts: I am not a MapInfo user, but I have been asked whether that software can assign/join tabulated data to GIS features like buildings, roads and watercourses?


texts:
we have a (Geocode Service) which has enabled with Batch Geocoding parameters as

now when we test the service like

 {x:-83.000369, y:40.055185} , {x:-83.000031, y:40.051250}

at

It only returns one Point

Point:
X: -83.00030916909509
Y: 40.05520839180167
Spatial Reference: 4326  (4326)

can you please let me know what we are doing wrong?


texts: Wrong axis order in geotools crs when reading from EPSG:4326

texts:
Map<String,Object> params = ...; // postgis params
DataStore dataStore = DataStoreFinder.getDataStore(params);
SimpleFeatureCollection collection=...;// collection to save
SimpleFeatureType schema = collection.getSchema();
dataStore.createSchema(schema); // but it creates with name "polygon"
MyUtils.save(collection,dataStore);  // saves to database

schema before save: collection.getSchema().getCoordinateReferenceSystem().getCoordinateSystem().toString() :

EllipsoidalCS["GCS_WGS_1984",
 AXIS["longitude", EAST],
 AXIS["latitude", NORTH]]

postgresql table column definition:

fid          serial NOT NULL
the_geom     geometry(Point,4326)
Name         character varying(93)

But when I read a collection from the same source, I face:
schema after read: collection.getSchema().getCoordinateReferenceSystem().getCoordinateSystem().toString():

EllipsoidalCS["Ellipsoidal 2D CS. Axes: latitude, longitude. Orientation: north, east. UoM: degree",
 AXIS["Geodetic latitude", NORTH],
 AXIS["Geodetic longitude", EAST],
 AUTHORITY["EPSG","6422"]]

The problem is that the x y coordinates are displaced in the schema but the point values are not.
I gues geotools cannot decode "EPSG:4326" correctly. CRS.decode(string,boolean longitudeFirst) guides to solution and a related question answered here, but we can't change the collection.getSchema().
Problem of that question was creating a CRS with corrent axis order, but my problem is reading a feature collection with correct CRS.


texts: Fieldmapping for mean and max using arcpy

texts:
I'm trying to spatial join two features. One polygon layer and one point layer. The point layer contains one field of values that I want the Mean and Min of. Im trying to use the fieldmaper object to set the merge rules for two fields ("Mean" and "Max").

I get this error "RuntimeError: FieldMappings: Error in adding table to field mappings" while running it in python for ArcMap. How can I fix this?

falling_tree = arcpy.env.workspace+'\\'+ 'Falling_tree_3_meter.shp'

buffer_area = arcpy.env.workspace+'\\'+'Buffer_erased'

arcpy.AddField_management(buffer_area,"Max", "DOUBLE")
arcpy.AddField_management(buffer_area,"Mean", "DOUBLE")

targetFeatures = buffer_area
joinFeatures = falling_tree
outputFeatures = arcpy.env.workspace+'\\'+'Joine_tre'

fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(buffer_area)
fieldmappings.addTable(falling_tree)

MaxFieldIndex = fieldmappings.findFieldMapIndex("Max")
fieldmap1 = fieldmappings.getFieldMap(MaxFieldIndex)
fieldmap1.mergeRule = 'MIN'

MeanFieldIndex = fieldmappings.findFieldMapIndex("Mean")
fieldmap2 = fieldmappings.getFieldMap(MeanFieldIndex)
fieldmap2.mergeRule = 'MEAN'

fieldmappings.addFieldMap(fieldmap1)
fieldmappings.addFieldMap(fieldmap2)

arcpy.SpatialJoin_analysis(buffer_area,falling_tree,
arcpy.env.workspace+'\\'+'Joine_tre', "JOIN_ONE_TO_ONE", "KEEP_ALL", fieldmappings, "INTERSECT")


texts: Arcpy SelectLayerByAttribute_management where_clause with LIKE not returning like values

texts:
I am selecting 2 intersections from a shape file using info from a File Geodatabase Table. The values are very similar as shown in example at the bottom. I am using a LIKE in the statement but it is not returning values that should be there. It is rather lengthy but I'll try to cut it down.

    Whereclausefrom = '''"FULSTRT" LIKE '%{road}%' AND "FulStrt2" LIKE '%{fromst}%\''''.format(road=roadname, fromst=fromstreet)
    arcpy.MakeFeatureLayer_management('IntersectionPoints', 'temp_Intersection', Whereclausefrom)

    Whereclauseto = '''"FULSTRT" LIKE '%{road}%' AND "FulStrt2" LIKE '%{tost}%\''''.format(road=roadname, tost=tostreet)
    arcpy.MakeFeatureLayer_management('IntersectionPoints', 'temp_IntersectionTo', Whereclauseto)

    Num1 = int(arcpy.GetCount_management("temp_Intersection").getOutput(0))
    Num2 = int(arcpy.GetCount_management("temp_IntersectionTo").getOutput(0))
    Num = Num1 + Num2

    if Num1 < 1:
      Whereclausefrom2 = '''"FULSTRT" LIKE '%{fromst}%' AND "FulStrt2" LIKE '%{road}%\''''.format(road=roadname, fromst=fromstreet)
      arcpy.MakeFeatureLayer_management('IntersectionPoints', 'temp_Intersection', Whereclausefrom2)
    if Num2 < 1:
      Whereclauseto2 = '''"FULSTRT" LIKE '%{tost}%' AND "FulStrt2" LIKE '%{road}%\''''.format(road=roadname, tost=tostreet)
      arcpy.MakeFeatureLayer_management('IntersectionPoints', 'temp_IntersectionTo', Whereclauseto2)

    Num1 = int(arcpy.GetCount_management("temp_Intersection").getOutput(0))
    Num2 = int(arcpy.GetCount_management("temp_IntersectionTo").getOutput(0))
    Num = Num1 + Num2

    if Num != 2:
      brokenRecord()
      brokencount = brokencount + 1
      writeText("Record added to Failed Records. Next Record")

    else:

      ## rest of script if there is exactly 1 from and exactly 1 to selected


texts:
I'm looking for the QGIS equivalent of TopoJSON's mesh function which goes through a vector layer and only keeps borders that are shared between multiple features. Here's an example of the output -- the black lines are only drawn for internal borders between states:

Is there a way of achieving this in QGIS, without going through TopoJSON? The reason I'm asking is that I'm working with extremely detailed shapefiles and would like to avoid converting from SHP to TopoJSON and back to SHP if possible.

The shapefiles I'm using are topologically correct, ie the arcs of the features line up perfectly.


texts: PyQGIS API code completion not working in PyCharm In QGIS3.10 on Windows10

texts:
I am configuring Pycharm 2020.3 to work with QGIS3.10 on Windows.
I have followed the various instructions from previous answers. Configure the interpreter.
Pycharm recognizes Qt including autocompletion of PyQt Class.

I can also run the QGIS matplotlib by changing the aggt configuration to Qt.
I can run processing scripts

However, it does not recognize all QGIS class documentation. In the image it shows only the suggestion of the main modules.

But it does not show anything for classes, it does not recognize documentation for a class for example QgsVectorLayer.
I use this .bat file to set up and run pycharm
@echo off
set OSGEO4W_ROOT=c:\PROGRA~1\QGIS3~1.10
set path=%OSGEO4W_ROOT%\bin;%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\WBem

call o4w_env.bat
call qt5_env.bat
call py3_env.bat

@echo off
path %PATH%;C:\Program Files\QGIS 3.10\apps\grass\grass78\lib
path %PATH%;C:\Program Files\QGIS 3.10\apps\Qt5\bin
path %PATH%;C:\Program Files\QGIS 3.10\apps\Python37\Scripts
path %OSGEO4W_ROOT%\apps\qgis-ltr\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis-ltr
set GDAL_FILENAME_IS_UTF8=YES
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\qtplugins;%QT_PLUGIN_PATH%
set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis-ltr\python;%PYTHONPATH%

set PYCHARM="c:\Program Files\JetBrains\PyCharm Community Edition 2020.3.4\bin\pycharm64.exe"
@echo on
start "PyCharm with QGIS knowledge!" /B %PYCHARM% %*


texts:
I am trying to export a Postgis database table into KML using ogr2ogr.
When I execute this command in terminal (Ubuntu 12) I just get the "documentation" back but no result or error:

ogr2ogr -f "KML" mykml.kml PG:"host=localhost user=**** dbname=nga_test password=***" "public.chalandri" -s_srs EPSG:2100 -t_src EPSG:4326

Is this normal?


texts: carto giving error: TypeError: Cannot read property 'hasOwnProperty' of undefined

texts:
I have a new ubuntu 17.10 server that Im building an Open Streetmap Server on.  I installed carto and am now getting this error:

    osm@atlantageek-System-Product-Name:~/openstreetmap-carto-2.41.0$ carto project.mml > style.xml
/usr/lib/nodejs/carto/lib/carto/tree/reference.js:19
    if (mapnik_reference.version.hasOwnProperty(version)) {
                                ^

TypeError: Cannot read property 'hasOwnProperty' of undefined
    at Object.ref.setVersion (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:19:33)
    at /usr/lib/nodejs/carto/lib/carto/tree/reference.js:209:5
    at Object.<anonymous> (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:213:3)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Im running node 8.2.1


texts: TypeError: 'NoneType' object is not iterable from Python Scripting for Geoprocessing Workflow exercise?

texts:
I am currently taking ESRI's Python Scripting for Geoprocessing Workflows. I have following their step by step however there seem to be a problem that I am getting an error.

import arcpy
#Set geoprocessing environments
arcpy.env.workspace = "C:/Student/PythonGP10_0/Data/SanJuan.gdb)"

arcpy.env.overwriteOutput = True

#Create list of feature classes in SanJuan.gdb
fclList = arcpy.ListFeatureClasses()

#Create a loop to buffer Lakes and Streams
bufferList = []
for fc in fcList:
    if fc == "Lakes" or fc == "Streams":
        arcpy.Buffer_analysis(fc, fc + "Buffer", "1000 meters")
        bufferList.append(fc + "Buffer")
arcpy.Union_analysis(bufferList, "WaterBuffers")

The error I get here from the IDE Window shows the error:

PythonWin 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> import arcpy
Traceback (most recent call last):
  File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Student\PythonGP10_0\Scripts\BufferWater.py", line 9, in <module>
    for fc in fcList:
TypeError: 'NoneType' object is not iterable


texts: geometryType property of Vector Layers in OpenLayers

texts:
ORIGINAL:

I have a couple questions that are focused around the geometryType property with vector layers.  When you create a vector layer you can set the geometryType property to limit the geometry types the layer supports...

  {String} geometryType allows you to limit the types of geometries this layer supports.  This should be set to something like “OpenLayers.Geometry.Point” to limit types. -- OpenLayers API Docs

but in the Vector.js file the code is looking for an object when checking the geometry

 if (this.geometryType &&
          !(feature.geometry instanceof this.geometryType)) {
            var throwStr = OpenLayers.i18n('componentShouldBe',
                      {'geomType':this.geometryType.prototype.CLASS_NAME});
            throw throwStr;
          }

Is this a typo in the API Docs or am I doing something wrong here?

On a related note if I set the geometryType of a VectorLayer to be OpenLayers.Geometry.Polygon and then try to edit geometry of features in that layer it doesn't want to work because it tries to insert OpenLayers.Geometry.Point geometries into the layer to represent the draggable vertices.

Is there a something built in to get around this or do I need to write something to handle this?

Thank you for any help.

UPDATE:

This seems to work but I'll be running more tests.

Vector.js

    // Override for geometryType.
    var geometryType = options && options.geometryType !== undefined ? options.geometryType : this.geometryType;

ModifyFeature.js

// Where "addFeatures" exist I've tacked on the geometryType
this.layer.addFeatures([this.radiusHandle], {silent: true, geometryType: OpenLayers.Geometry.Point});

Thanks for the help!!


texts: Change Date to Future Date in Map Title Using Python or Dynamic Text

texts:
I'm trying to create a dynamic map title in ArcMap that updates based on current day + 2 days. For example, if I run the code on the 20th of a given month, the title should update to show the 22nd.

I've arrived at two independent, but partial solutions: the first works in pure Python not integrated with ArcMap and the second works using Dynamic Text (but only for the current date). I'm not partial to one method over another, but am not familiar enough with either to arrive at a satisfactory solution. Is anyone aware of a way to use either of these methods to solve the issue?

Partial Solution #1 - Python code

from datetime import date, timedelta
import calendar
publication_date = date.today() + timedelta(days=2)
publication_day_of_week = calendar.day_name[publication_date.weekday()]

#Title format example:
#"Forecast for Thursday March 17"
print "Forecast for " + publication_day_of_week + " " + publication_date.strftime("%B %d")

Running this script as of today (March 17, 2016) correctly yields the text "Forecast for Saturday March 19"

Partial Solution #2 - ArcMap Dynamic Text tags

<dyn type="document" property="title"/> <dyn type="date" format="dddd MMMM d"/">

The title property above represents the text "Forecast for" which is followed by the formatted date.

However, the output is "Forecast for Thursday March 17"-- the current date. As far as I can tell, dynamic text can only use the current date, time, etc., and cannot be used to forecast 2 days out from the current date.

I've already reviewed the following but can't seem to see a complete solution:

1) http://pro.arcgis.com/en/pro-app/help/layouts/date-and-time-dynamic-text.htm

2) https://geonet.esri.com/thread/21281

3) Dynamic title in ArcMap


texts: Understanding QGIS API documentation to write Python code using QgsVectorLayer?

texts:
I am not sure how to use the API documentation to code in Python.
For example, I want to determine whether a layer is a point, line or polygon layer and found the following in the API documentation:

I have selected the lakes shapefile from the QGIS alaska dataset. In the QGis Python console, I have typed:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
canvas = self.iface.mapCanvas()
cLayer = canvas.currentLayer()
type(cLayer)

The returned value is: <class 'qgis.core.QgsVectorLayer'>.
How do I use the above information in the API documentation to (1) determine the type of the selected layer and (2) return the value of the listed enumerate types (e.g. polygon)?  Whilst I am sure someone can tell me the answer, I would really like to know how to work out the answer using the API documentation and any other available documentation.


texts: Using Geometry commands in MS SQL Server 2008?

texts:
I am looking to find the most effect way to use SDE and ST_Geometry SQL commands.

Can anyone tell me how/what commands I might use to perform a spatial query in MS Sql Server 2008, to Select property parcels that are contained by or cross the boundary of a flood area layer?

I then have to export the result (containing, owner, and address details) to some format that can be used to do a mail out. I would also have to create a site specific map for each property affected. Showing the neighbourhood parcels, specific owners parcel, flood potential layer and roads.


texts: I have an Android app when I have multiple polygons of a person's position, and I want the intersection of these polygon to know his exact position.


texts: How to deal with conflicting agency identifiers from different GTFS sources in the same router?

texts:
Scenario: One OTP (Open Trip Planner) router which has multiple, say 2 for example, GTFS (General Transit Feed Specification) feeds. Each feed is generated by different agencies, one has trains and the other buses.
However both have the agency id set to 1 in the GTFS feed, which is correct since according to the spec this agency is is only guarantied to be unique within a data set, in these case there are two separate data sets.

Is it possible to control how these ids are handled by OTP?

I need to query them using the REST API but can't predict which id they would get, since it is determined by OTP on load.

Any suggestions?

More detail:
The rest api call looks like the one below (more info in the OTP rest apidoc). The {routerId} is fixed in configuration, so its known and there is no problem with it. However, the {stopId} it is formed by concatenating the agencyId and the stopId (the later one being the stopId from the feed so its known).

/routers/{routerId}/index/stops/{stopId}

Example:
Lets suppose two feeds that define an agency each one:

1, AgencyA, ......

1, AgencyB, ......

Each feed guaranties that the AgencyId (1 in both cases) its unique within then feed, so they may be the same (because they are two separate feeds).

Also each feed defines a stop (which may or may not have the same stop id, let's assume they are different in this case) as follow:

1, Stop1, .....

2, Stop2, .....

Finally we set this in a OTP router named sandbox.

The rest call would look like this for the stop from AgencyA:

/routers/{routerId}/index/stops/1:1

Where the first 1 corresponds to the agency id, and the later to the stop.

But because both agencies have the same id, the second one would get its id changed to F1 (at least in version 0.19 which is the one I', using right now), so the rest call would look like:

/routers/{routerId}/index/stops/F1:2

The problem is how can I know the newly created agencyId and if it is possible to control it on import. I could configure the client so it knows which otpAgencyId corresponds to which agencyId from a feed, but if I add a new GTFS feed these ids may change requiring reocnfiguration. So I has hopping  to be able to control the ids set by OTP so they are asigned in a deterministic way.


texts: Millions of polygons: displaying layers in Leaflet based on location being viewed?

texts:
I'm trying to create a map of all parcels in a state. In my state, this is several million parcels.

In their current format, they are encoded as topojson and divided up by county. I'd like to show only a certain county's parcels at a time, preferably when the user is zoomed in on that county.

Is there a way to achieve this? I'm open to alternative map libraries / ideas.


texts: Part of feature belongs to wrong feature

texts: Is there a quick way (without having to create new layers) to make the island circled in the bottom left a part of central america (dark blue) rather than a -part of Central France (yellow)?


texts: Applying different styles for polygons in OpenLayers

texts:
I have succeeded drawing polygons depending on long/lat coordinates as in the following link

https://jsfiddle.net/api/post/library/pure/#&togetherjs=P5VkiiyuCO

However, what I want to do more is to specify a different color for each polygon, depending on other filed that contains different value for each polygon.

Is it possible to draw polygons with different styles?


texts:
Is there any possibility to add markers from PruneCluster to layerGroup. I need to add them to the search control and as the doc points. I have to create a searchLayer which is a layerGroup where I have to add all my markers then configure the searchControl with the layerGroup and the other properties.
I attempted it this way :
var searchLayer = new L.layerGroup()

    for (var marker in pruneCluster.Cluster._markers) {
        searchLayer.addLayer(pruneCluster.Cluster._markers[marker])
    }

    console.log(searchLayer)

    /* var searchLayer = L.layerGroup([markersArbres], [markersMam], [markersParcs], [markersPois], [markersSibes], [markersZh], [markersAmp], [markersOis], [markersRep])*/

    //console.log(searchLayer)
    //... adding data in searchLayer ...

    var searchControl = new L.Control.Search({
        layer: searchLayer,
        propertyName: 'titre',
        circleLocation: true,
        moveToLocation: function(latlng, title, map) {
            //map.fitBounds( latlng.layer.getBounds() );
            //var zoom = map.getBoundsZoom(latlng.layer.getBounds());
            map.setView(latlng, 14);

            //console.log("hey", this)

            // access the zoom
        },
        buildTip: function(text, val) {
            var imgCat = ""
            console.log(val.layer.feature.properties.category_image)
            return `

                     ${text}

`;
        }
    })
    mymap.addControl(searchControl);

when I log the searchLayer I can see that the markers were added to the property _layers but I also get this error : The provided object is not a Layer.
Have you any Idea about why the markers added to the searchLayer are not valid?


texts: QGIS create layer from spreadsheet file (Spreadsheet Layer plugin)

texts:
With the QGIS plugin 'Speadsheet Layers' i try to create a layer with the following parameters:

But I'm just getting a layer with no geometry. I've been playing arround with real instead of integers, as well as removing lines containing no coordinates, but no effect.

Did anyone make it to get a point layer out of a spreadsheet? What am I probably missing?


texts: QGIS, How to label a layer in different font sizes, shrink to fit in polygon or a multiple line label?

texts:
I am just trying to figure out how to label a polygon layer to fit its size in QGIS. or if its very long title should break in line and scale, i did some research but couldn't find anything helpful is there any expression or code to apply?

As this Sample


texts: how to assign unique attribute value per neighborhood?

texts:
I have a feature class of adjacent polygons and I want to assign an integer attribute value to my polygons based on the following rules :

a polygon must not have the same attribute value than any of its neighbours
the number of attribute values must be as small as possible (I don't want to use the FIDs, because I want to convert my polygons to an 8-bit raster, so I can use no more than 256 values)

Here is a small example :

I am planning to loop on all features, look for neighbours, and assign the smallest possible value, but maybe there is a more efficient algorithm or an existing tool. QGIS and ArcGIS 10.1 solutions are both welcome.


texts: Creating Wedge Polygon ArcGIS using Python with tangent off one buffered point

texts:
I am trying to write a Python code that would create a wedge polygon from two points, with second point buffered to certain distance and then using tangent.

Point A is the origin point, Point B is at a distance from Point A, and is buffered to a certain distance, say 20 feet.  The wedge will be off the tangent on both sides of the buffered Point B, extending to a certain distance.

I have attached a graphic that shows what I am seeking.  The light red area indicates the area I am seeking to create.


texts: Layer name for Extract selected features

texts: When running processing's 'Extract selected features' with the option of 'Create temporary layer' (in memory), the resulting layer is always called 'Selected features'. Can this name be customized from the script? The documentation doesn't provide an answer.


texts: What components does OpenLayers.Strategy.BBOX require for compilation?

texts:
I recompiled OpenLayers with minimal settings, and now Vector layer, that uses BBOX strategy, stopped adding bbox parameter to the queries.

What components do I need to add?

This is the current config:

[first]
[last]
[include]
OpenLayers/Map.js
OpenLayers/Kinetic.js
OpenLayers/Projection.js
OpenLayers/Layer/Vector.js
OpenLayers/Layer/OSM.js
OpenLayers/Layer/Bing.js
OpenLayers/Layer/WMS.js
OpenLayers/Layer/Google/v3.js
OpenLayers/Popup/FramedCloud.js
OpenLayers/Control/Navigation.js
OpenLayers/Control/Zoom.js
OpenLayers/Control/Attribution.js
OpenLayers/Control/SelectFeature.js
OpenLayers/Control/Panel.js
OpenLayers/Control/LayerSwitcher.js
OpenLayers/Renderer/SVG.js
OpenLayers/Renderer/VML.js
OpenLayers/Format/GeoJSON.js
OpenLayers/Protocol/HTTP.js
OpenLayers/Strategy/Fixed.js
OpenLayers/Strategy/BBOX.js
OpenLayers/StyleMap.js
OpenLayers/Rule.js
OpenLayers/Filter/Comparison.js
OpenLayers/Filter/Logical.js
[exclude]

This is quite important, because the complete OL is 990K, while the minimal is only 350K big, and my users may be in remote areas with very slow connections.

It was not just Filter/Spatial. I noticed that even with Spatial it didn't compose a query string. I bisected the whole list of components and it was... OpenLayers/Format/QueryStringFilter.js.


texts:
I am working on a project to detect clearcut logging. i'm using the the methodology proposed by IRSTEA in 2015.
To filter NDVI images calculated from sentinel 2 images, I'm using the QGIS command (Raster > Analysis > Sieve) on binary images. My problems it that it does not run at all with an error message "the process planted some time after being launched".
Qgis 2.14.3

Any ideas why?


texts: Removing individual Leaflet markers added through L.geoJSON

texts:
I'd like to click on a button in a sidebar outside a Leaflet map and remove a marker associated with that button. But when I bulk add data through L.geoJSON, the function appears to not create individual variables for markers, making it impossible to simply use .remove(map) on that variable / marker.
The geoJSON looks like this:
var places = {"type": "FeatureCollection", "features": [{"id": "0", "type": "Feature", "properties": {"WIKIPEDIA": "Beni Department"}, "geometry": {"type": "Point", "coordinates": [-65.683972, -15.43334]}}, {"id": "1", "type": "Feature", "properties": {"WIKIPEDIA": "Bluefish Caves"}, "geometry": {"type": "Point", "coordinates": [-140.518611, 64.135278]}}]}
I've tried dynamically associating a variable with each marker by doing this:
  geojson = L.geoJSON(places, {
      pointToLayer: function (feature, latlng) {
          var "_" + String(feature.id) + "_" = L.circleMarker(latlng, geojsonMarkerOptions);
          return L.circleMarker(latlng, geojsonMarkerOptions);
      }
  }).addTo(map);

But that gives me a SyntaxError: missing variable name.


texts: Arcscene 3D.wrl file to interactive 3D pdf

texts:
I want to create an interactive 3D PDF for my customer from my 3D data in ArcScene, which seems easy in principle but is becoming an odyssey.

I would like to know if someone have any easy solution for this issue, or if know any freeware player to visualize arcscene 3D models.


texts: GRASS algorithms not working in QGIS 2.18.5

texts:
I've installed QGIS Las Palmas and still trying to learn its capabilities.

There is however problem with GRASS algorithms grouped in the geoprocessing tools. Some of them work (item 2) and others don't (item 1).

When trying to run any of the group nr 1, following message pops up:

How do I configure mentioned folder to make them run?

I am new to QGIS.

QGIS ver: 2.18.5 Las Palmas
OS: Win 7 PRO x64


texts:
I have a list of lines and I want to create a polygon from them using PostgreSQL. I can't find a function that gets a list or an array of lines and returns a polygon.

For example I have the following lines:

SELECT 'LINESTRING(12.50226 41.900927,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.0974 41.9967)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.90093,12.0644 41.953876)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.90093,12.0644 41.953876)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.0974 41.9967)' AS WKT UNION ALL
SELECT 'LINESTRING(12.507033 41.896497,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.507033 41.896497,12.076105 41.949897)' AS WKT

My main goal is to create a corridor from group of lines. I think the best way to do it is to create a polygon.

Is there a better way, if not, how can I create it using PostGIS?

The following picture is the lines:

I would like to create the following polygon

Or to create a main route of the lines:


texts: OpenLayers: How to make visible long lat of place after click on map from my partial code?

texts:
I found this code for make visible EPSG:4326 gps after moving the mouse over the map. And I rewrite to html page with newest OpenLayers version.

But I need edit this small thing:
I prefer to make visible long lat coordinates, no EPSG:4326 coordinates as in the code. I tried to write long lat instead of GPS but it never gave me these coordinates.

I use OpenLayers version 6.

Rewrite code from page:

<!doctype html>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.0/css/ol.css" type="text/css">

    <title>OpenLayers example</title>

My Map


texts: I want to visualize some statistical data about my country and I'm using the CartoDB geocoder. I've city names and I want to see cities as polygons but CartoDB says it has no polygon data, it can only provide point data. I can download polygon data from the GADM GADM web site. Any ideas how can it be done on CartoDB?


texts:
According to my understanding, the Multiple Flow Direction (MFD) algorithm was originally defined in The Prediction of Hillslope Flow Paths for Distributed Hydrological Modelling using Digital Terrain Models by Quinn et al. 1991. Since then it seems to have been renamed to FD8 to prevent confusion and I believe some may even refer to it as MD8 but I have failed to discover when this happened. This originally caused some confusion on a project I am working on.

I am looking for a reference or an explanation for when MFD became known as FD8 and if MD8 is also a valid name for the algorithm or am I mixing algorithms altogether?


texts: Let me preface by saying I'm a beginner but have read a lot and can't find what I need. I have a set of coordinates from QGIS that I want to upload to Google Earth Engine and I can get as far as importing the table but none of the scripts I've found seem to be working to add them to my map. What am I missing? I just need the points to display or to figure out how to get my dNBR layers from GEE to QGIS.


texts: ArcGIS Combine Fuzzy Membership and Weighted Sum

texts:
I would like to combine the workflow of fuzzy membership and weighted overlay for a suitability analysis and would like to ask if this is "allowed" scientifically.

I have severeal criteria, some would first use Fuzzy Membership to get a membership value from 0-1, some other criteria do not use Fuzzy Membership before (they get a Value from 0-10 through another method).

Then I would standardize the fuzzy value...multiply it with 10, that all criteria have values from 0-10.

After that I wouldn't use "Fuzzy Overlay", but I would use "Weighted Sum" and weight all criteria.

Now my question is: Is this "allowed" to combine Fuzzy membership and Weighted Overlay, or do I have to use "fuzzy overlay" when I work with fuzzy memberships? I would use "Fuzzy Membership" just for the standardization.


texts: Getting a weird error trying to set MultiLineString Coordinates

texts:
I am trying to modify a multilinestring to add z coordinates to it but right now I am just trying to modify the line in anyway.

var line = event.features[4].getGeometry();
line.setLayout("XYZ");
line.setCoordinates([[-13550819.200333662,5691512.507689305,0],
    [-1350000.200333662,5200000.507689305,0],
    [-1300000.200333662,5000000.507689305,0]]);

is giving me the error:

Uncaught AssertionError: Failure: unsupported stride: undefined

I have inspected the object and the layout is indeed XYZ and the stride is 3. I presume stride is number of coordinates.


texts:
Suppose I already have a way to compute the centroids of different geometry types:

Points (arithmetic mean of Cartesian coordinates).
Linestrings (polylines) (weighted mean of segment mid-points in Cartesian coordinates, weighted by great-circle distance).
Polygons (weighted mean of spherical triangle centroids converted to Cartesian coordinates, weighted by spherical triangle areas).

I've included my methods for computing each type of centroid, but they can probably be ignored.

According to the PostGIS documentation for ST_Centroid:

  The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid).

The dimension here refers to points (0), lines (1) and polygons (2).

What is the most consistent way of defining the centroid if the geometries of highest dimension have undefined (ambiguous) centroids?  There are two possibilities:

The combined centroid is also undefined (I assume this is what ST_Centroid does).
The combined centroid is equal to that of the geometries of highest dimension with non-zero weight.  If a geometry has no defined centroid, then we give it zero weight.

An example ambiguous situation is an equally-spaced LineString going around the equator.  In this case, the centre of mass is at the sphere's origin.  Another situation is two hemispherical polygons, N and S, covering the whole sphere.  If such ambiguous geometries are combined with a point, should the point be the centroid?

One possibility is to interpret the centroids physically: the Earth is an invisible sphere suspended by a string, such that it can rotate about its centre. The centroid is therefore the point at the southernmost point if a collection of features are present on the spherical surface and the sphere is allowed to spin until it comes to rest.

In this situation, it seems reasonable that if the sphere is covered by area polygons, then adding a single point (of infinitesimally small area) is sufficient to make it come to rest at that point.


texts: Installing two versions of QGIS in Ubuntu?

texts:
I would like to have two versions of QGIS (2.8.2 and 2.8.10) in Ubuntu 14.04.

I have tried to do it by using the SIG sem grilhetas tutorial.

However, it didn't install qgis 2.8.2 in my ubuntu 14.04.
I have already installed qgis, but was the newest version (2.8.10). I would like to have 2.8.2 and 2.8.10 in my computer at the same time.

When I did above tutorial appeared this error message:

  CMake Error: The following variables are used in this project, but
  they are set to NOTFOUND. Please set them or make sure they are set
  and tested correctly in the CMake files: QWTPOLAR_INCLUDE_DIR used as
  include directory in directory /home/clement/dev/cpp/QGIS/src/app used
  as include directory in directory /home/clement/dev/cpp/QGIS/src/app
  QWTPOLAR_LIBRARY linked by target "qgis" in directory
  /home/clement/dev/cpp/QGIS/src/app linked by target "qgis_app" in
  directory /home/clement/dev/cpp/QGIS/src/app linked by target
  "qgis_qgisappclipboard" in directory
  /home/clement/dev/cpp/QGIS/tests/src/app

Anyone help me?


texts: ArcObjects C#: select intersecting polylines

texts:
My questions seems trivial but it is a real blocker for me. So please help!!!

How can I, using ArcObjects with C#, select only those polylines in one layer that intersect with each other?

It sounds like a very straight forward task, but I can't find another way than using a feature cursor. Which would take ages and is not efficient from my point of view.

Many Thanks in advance!

Hubert


texts: 'QgsVectorLayer' object has no attribute 'selectedFeatureIds'

texts:
I have a stand-alone PyQGis program and I need to periodically access the selected features of some vector layers. But I noticed that there seems to be no python wrapper for the 'selectedFeatureIds' or the 'getSelectedFeatures' methods of QgsVectorLayer class. There is a python wrapper for the 'selectedFeatures' function, but the documentation says that it actually makes copies of the selected features, which I don't want, all I want is to be able to iterate through selected features without duplicating anything. The QGis core is from QGis 2.12 (lyon) and PyQt4.

So this means there is no good way of getting access to the selected features in a layer in pyqgis apps.


texts: Proxy configuration problem with Glassfish and GeoServer

texts:
I have Geoserver running on 8080 and Glassfish on 9999.So for wfs-t i had to use some proxy script.But at the response part of firebug i got following code:

http://localhost:9999/schemas/ows/1.0.0/owsExceptionReport.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">

Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@eba9b0


texts: Querying geometry in perimeter or square with SpatiaLite?

texts:
How can I query geometry in a perimeter or a square with SpatiaLite?

CREATE TABLE points (id INTEGER,geom GEOMETRY)
insert into points values (897, GeomFromText('POINT(40.0 3.0)'))

I've tried several functions:

select id, AsText(geom) from points where PtDistWithin(PointFromText(40.0,3.0),geom, 5000.0);
select id, AsText(geom) from points where ST_Distance(PointFromText(POINT(40.0 3.0)),geom)< 5000.0;
select id, AsText(geom) from points where MBRContains(BuildCircleMBR(40.0,3.0, 5000),geom);

None of those return any result, or they don't use meters (they return all or no result when I change the radius) so I have some trouble understanding how to use meters.

Note that I'm not using QGIS or other software, I'm calling SpatiaLite from python but it is only the SQL not Python that I seek help with here.


texts:
I need to search my geojson file by its feature properties (which were fields on the csv file before I converted it).

I found this search plugin but it doesn't meet my needs.

I need a search engine like lucene in elasticsearch that returns to me all the GPS points with a specific condition.

Is that possible?
If yes how?

Edit :
 this is an example of geojson files :

{"features": [{"geometry": {"coordinates": [40.81072617, -73.95240784], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.71183395, -73.96302032], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.75595093, -73.84346008], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.75424576, -73.92481232], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.75645065, -73.92950439], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.76170349, -73.9250412], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.74570465, -73.90320587], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.72134018, -73.84425354], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.70240021, -73.98892975], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.8044548, -73.95552826], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.71715546, -73.95846558], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.75831223, -73.9287262], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.74129486, -73.90457916], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.80869675, -73.94830322], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [40.8042717, -73.93263245], "type": "Point"}, "properties": {}, "type": "Feature"}], "type": "FeatureCollection"}


texts: How do I clip a raster to the shape of a polygon (non rectangle)

texts: I would like to clip a raster to follow the shape of a river, which has lots of meaders and bends. I have created a buffer for the river of 300m and was hoping to use this to clip the raster. However, the raster clips to a rectangle shape. Is there a way to change this? I am using ArcGIS Pro.


texts:
Using gdal, it is possible to obtain the subdatasets contained in a hdf file, using the function:

datasource.GetSubDatasets()

Is it also possible to assign subdatasets to the file using gdal, i.e. a command like:

datasource.SetSubDatasets()

If not, what is the best way to create this type of file with multiple data sets?


texts: Errors when looping through spatial join with python

texts:
I am attempting to loop through a list of inputs and create a spatial join for each.  My code works as desired for the first object in the list, but then throws an error.  Here is my code:

# set local variables
env.workspace = "mydatabase"
input_location = "myinput"

input_features = ["Element Point", "Element Line", "Element Polygon",
"Community or Other Point", "Community or Other Polygon"]
output_features = ["element_point", "element_line", "element_poly", "community_point",
"community_poly"]
county = "countylayer"

for input, output in zip(input_features, output_features):
    target_features = os.path.join(input_location, input)
    join_features = os.path.join(env.workspace, county)
    output_features = os.path.join(env.workspace, output)

    # create a new fieldmappings and add the two input feature classes as objects
    fieldmappings = arcpy.FieldMappings()
    fieldmappings.addTable(target_features)
    fieldmappings.addTable(join_features)

    # first gets COUNTY_NAM fieldmap which is a field in the counties feature class
    # the output will have the elements with the names of the counties
    county = fieldmappings.findFieldMapIndex("COUNTY_NAM")
    fieldmap = fieldmappings.getFieldMap(county)

    # get the output field's properties as a field object
    field = fieldmap.outputField

    # rename the field and pass the updated field object back into the field map
    field.name = "county"
    field.aliasName = "county"
    fieldmap.outputField = field

    # set the merge rule to first and then replace the old fieldmap in the mappings
    # object with the updated one
    fieldmap.mergeRule = "first"
    fieldmappings.replaceFieldMap(county, fieldmap)

    for field in fieldmappings.fields:
        if field.name not in ["county", "refcode","dm_stat", "last_up_by", "last_up_on"]:
            fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex(field.name))

    # run the spatial join tool, using the defaults for the join operation and join
    # type
    arcpy.SpatialJoin_analysis(target_features, join_features, output_features, "#",
    "#", fieldmappings)

And here are the errors I am getting after it successfully completes the first spatial join:

Runtime error
Traceback (most recent call last):
  File "<string>", line 24, in <module>
  File "C:\Python27\ArcGIS10.4\Lib\ntpath.py", line 67, in join
    p_drive, p_path = splitdrive(p)
  File "C:\Python27\ArcGIS10.4\Lib\ntpath.py", line 115, in splitdrive
    if len(p) > 1:
TypeError: object of type 'int' has no len()


texts: What special values can be included in the Con tool's conditional statement?

texts:
I recently read an answer to this question, which used a rather creative solution involving ArcGIS's Raster Calculator. The part that I was most interested in was that the solution's conditional statement,

  Con("raster" == maxvalue, 1)

used the special variable maxvalue, clearly the input image's maximum value. I'm curious whether the maxvalue variable name can also be used within the conditional statement of the Con tool? The documentation for the tool hasn't revealed anything, which makes me think that perhaps it is restricted to the Raster Calculator.

If it is a valid conditional statement for use in the Con tool, then what other similar variables are possible? I assume there is a corresponding minvalue, but is there a variable for grid cell resolution? How about one for the northern coordinate of the edge of the raster or the y-coordinate for the grid cell?


texts: How can I make a polyline wrap around the world?

texts:
I am using leaflet maps to create a representation of a round-the-world challenge. I would like to add a polyline which heads east from tokyo and then appears west of south america on the map - but instead I get a line which crosses the map in the opposite direction (see yellow line).

I think this is probably related to datelines and /or coordinate systems but am a bit sketchy on the detail. Can anyone explain the theory behind what I need to do to get this to work? I am using the bluemarble projection from Nasa:

var bluemarble = new L.TileLayer.WMS("http://demo.opengeo.org/geoserver/wms", {
layers: 'bluemarble',
attribution: "Data &copy; NASA Blue Marble, image service by OpenGeo",
minZoom: 2,
maxZoom: 5
});


texts: How do I initialize the ArcGIS proxy via server side .NET code (C#)?

texts:
I know how to do this via JavaScript code:

esri.config.defaults.io.proxyUrl = "../proxy.ashx";

But, how do I do this in .NET?  I am very new to the GIS space.


texts:
I am looking to find a dataset/shapefile of a Building footprint/outlines for the city of Detroit. I have found this dateset of detroit parcels but I need Building Footprints!

http://d3.d3.opendata.arcgis.com/datasets/7cfed5afb7654e2495ef4c1ead320aa5_0


texts: I used SNAP sentinel 1 to calculate subsidence. After snaphu export I open snaphu.conf and copy command as below then run it in Terminal. I got the following error in picture:


texts: Login as another user in PostGIS using QGIS 2.18 without restart

texts:
I have a PostGIS DB with three roles: admin, user and readonly.

When I set up a connection to this database via "Add PostGIS layer" this connection is saved as it should be. So I login as admin to create some tables. I don't save any login informations.

But now I have no possibility to logout and re-login as another user e.g. to check if I set up permissions correctly or whatever.

I tried to reconnect via "Add PostGIS layer" but this has no effect.
The only way to do this seems to close QGIS and restart it.

Is there another way to logout and re-login as another user? For now this has to be done using QGIS 2.18.

Figured out I can run 3 instances of QGIS with 3 different login-informations at the same time. Better than restarting, but not the "solution" I was hoping for...


texts: SQL to get points within certain distance

texts:
I got about 2 million points in a spatialite database would like to get which points are withina radius of 30 km from another point. All data is in WGS84 but I need distance in km. Also it would be handy to summarize by some field

I tried spatial query in QGIS but crashed due to the size


texts: OpenLayers 3: World is wrapped but Vector layers are not repeated

texts:
With OpenLayers v.3.1.1, the world is wrapped so that you can pan without limits horizontally or along the axis of Longitude but features on a Vector layer are not repeated, should you pan beyond the original instance of the base layer. I find this is very inconsistent and makes for a terrible user experience!

I want to either prevent horizontal wrapping around the date-line of the base layer or force vector layers to be repeated similarly to the tiles of the base layer.

Apparently, there used to be a wrapX property on some sources or wrapDateLine property on Layer but neither of those are documented in the API documentation for v.3.1.1: http://openlayers.org/en/v3.1.1/apidoc/

In fact, I can find no reference to them at all and no alternative solutions to the problem.

Is there some way to either prevent world wrapping or to cause vector layers to wrap, too?


texts:
I am investigating the use of MapInfo to apply transformations between GDA94 and GDA2020.
I am using MapInfo Pro 2019.1 so the NTv2.xml file has 10 entries relevant to Australia. They come in pair wise either conformal v conformal and distortion or 116 to 1028 or 1006 to 1028. Specifically the ones I am interested in are:
NTv2 Conversion for Australia
GDA94_GDA2020_conformal.gsb
DatumID 116 to 1028
NTv2 Conversion for Australia
GDA94_GDA2020_conformal.gsb
DatumID 1006 to 1028
NTv2 Conversion for Australia
GDA94_GDA2020_conformal_and_distortion.gsb
DatumID 116 to 1028
NTv2 Conversion for Australia
GDA94_GDA2020_conformal_and_distortion.gsb
DatumID 1006 to 1028
The built in transformation (probably the 7 parameter similarity transformation works fine. The release notes for MapInfo 17.0  Pro say to enable the the NTv2 by editing the Enabled tag and then implies that the NTv2 transformation will then be used.
However I could not find any way to specify which transformation, and to verify which transformation is being used.
Yes I have the relevant *.gsb files.
Do I have to enable just one transformation at a time say GDA94_GDA2020_conformal_and_distortion ?
If both the conformal and conformal_and_distortion transformations are enabled which MapInfo use?
How do I find out which transformation has been applied?
Or how do I specify which transformation to use.


texts: Seeking global roads information preferably with traffic volume?

texts:
Im looking for a high quality global roads database. The only constraints I have is that it should be completely open (even foe commercial use)
I have looked into some publicly available databases like SEDAC and TIGER. But SEDAC cannot be used for commercial purposes and TIGER is limited to US only.

I would also like if the data has traffic volume inherently (annual average will also work, daily estimates not required) or another traffic volume database which can be linked to the aforementioned roads database


texts: Select By Attributes Based on Unique Value in Shapefile gives ERROR 000840?

texts:
Using ArcGIS 10.4.1 and Arcpy I am trying to select a shapefile by it attributes and create new feature class based on unique values like

import arcpy
from arcpy import env

def unique_values(table , field):
    with arcpy.da.SearchCursor(table, [field]) as cursor:
        return sorted({row[0] for row in cursor})

uniques = unique_values(r'D:/GIS/Roads.shp' , 'fclass')
for unique in uniques:
    arcpy.SelectLayerByAttribute_management (r'D:/GIS/Roads.shp', "NEW_SELECTION", " 'fclass' = '"+unique+"' ")
    print (unique)

but I am getting this error message

  Message   File Name   Line    Position     Traceback
           11
      SelectLayerByAttribute    C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\management.py 7182
  ExecuteError: Failed to execute. Parameters are not valid. The value
  cannot be a feature class ERROR 000840: The value is not a Raster
  Layer. ERROR 000840: The value is not a Mosaic Layer. Failed to
  execute (SelectLayerByAttribute).


texts: Reorder or remove out-of-order epochs in Rinex file

texts:
I have some Rinex (2.11) files where something went wrong and every epoch is duplicated. Mostly they're in order, but sometimes there's an epoch out of order, like this:

AABBCCDDEFEFGGHHIIJJKLKLMMNN...

Is there a tool that can reorder or discard out-of-order epochs? Teqc will abort when it hits an out-of-order epoch, but will fix duplicates as long as they're adjacent. So far I've manually deleted the OOO epochs but that's rather tedious.


texts: Select distinct values from a single column of an attribute table (or layer)

texts:
Is there a way to select distinct values from a column in ArcMap?
I have the data in both GDB and SHP formats.
I have searched for ways to select using SQL, QueryLayers, ModelBuilder and individual toolboxes and it appears as all selection options always SELECT * FROM tableName WHERE ...

In SQL I would write SELECT DISTINCT columnName FROM tableName.


texts: QGIS does not recognize Arc-created shapefile CRS

texts:
I create a new point shapefile in QGIS (2.12) with EPSG:2927.  When I view the Layer's Properties, the CRS is correctly listed as EPSG:2927. Happy!

I then create a second point shapefile in Arc Catalog (10.0) using the same CRS.  However, when this shapefile is added to QGIS, the Layer Properties reports USER:100002.  Sad...

Why doesn't QGIS correctly recognize the Arc-created CRS, and what can I do to correct this reporting difference?

I should note that the Arcmap point features are correctly located when viewed in QGIS.


texts:
I am Trying to export from shapefile to autocad.
But it is not converted correctly.
My labels are not shown.


texts: Trigger a python script to run after a row is added to the feature class

texts:
I have a Python script which runs on a SDE feature class daily (as a scheduled task). I would actually like this script to run whenever a new row is added to the feature class (data is captured in the field using a mobile device and posted to the server).

I was considering using a trigger as mentioned in this question as my data is not versioned, but I do not want to overcomplicate things if there is an inbuilt SDE tool which can achieve this or something similar. The data is currently stored in ArcSDE 10/SQL Server 2008, but I do have ArcSDE 10.1/SQL Server 2012 available.

Currently when the script runs, it checks for NULL values in a certain field. If it finds it, it selects those rows and performs several geoprocessing operations on them. It then populates that field with a value to show that everything has been processed.

While I have a lot of experience editing/reconciling/posting/versioning SDE data, I only have limited experience with the database/admin side of it (assigning privileges, basic dabbling in SQL management studio), with a basic understanding of the underlying architecture.


texts: How to write table blob field to file using ArcObjects?

texts:
I have a table with blob field and some others as well. I am trying to read blob field and save it to file using IBlobStream, and the thing compiles. The problem comes up in run-time, when calling blobStream.SaveToFile() method, saying:

'object' does not contain a definition for 'SaveToFile'

the following code:

int blobFieldID= table.Fields.FindField("MODEL_NAME");
int nameFieldID= table.Fields.FindField("MODEL");
ICursor cursor = table.Search(null, true);
IRow row = cursor.NextRow();
while (row != null)
{
    IBlobStream blobStream = (IBlobStream)row.get_Value(blobFieldID);
    blobStream.SaveToFile(@"C:\TEMP\" + row.get_Value(nameFieldID) + ".tbx"); //error
    row = cursor.NextRow();
}

When i hover mouse over SaveToFile method it says:

(dynamic expression)
This operation will be resolved at runtime

I can't figure out what's the problem in here


texts:
I'm having trouble making a script tool in ArcGIS. I have developed a script that will edit certain values in the attribute table. Without incorporating a script tool this script works fine and edits the relevant attributes adequately. Here it is:

import arcpy

fc = "C:\Users\maureen\Documents\ArcGIS\EDRN\EDRN_LINK.shp"
fields = ["FID", "RIVERNAME", "SOURCE", "DRAINS", "RIVERTYPE", "LCC_USER"]

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == 4402:
            row[1] = "Calder"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == 4402:
            row[2] = "2009 Aerial Photography"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == 4402:
            row[3] = "NO"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == 4402:
            row[4] = "1"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == 4402:
            row[5] = "T0015685"
            cursor.updateRow(row)

When I edit the above and try to create a script tool my script is as follows:

import arcpy

fc = "C:\Users\maureen\Documents\ArcGIS\EDRN\EDRN_LINK.shp"
fields = ["FID", "SOURCE", "RIVERNAME", "RIVERTYPE", "DRAINS", "FRMMAINRIV",   "LCC_USER"]

f_id = arcpy.GetParameterAsText(0)
srce = arcpy.GetParameterAsText(1)
rvrnme = arcpy.GetParameterAsText(2)
rvrtyp = arcpy.GetParameterAsText(3)
drns = arcpy.GetParameterAsText(4)
fr_main_riv = arcpy.GetParameterAsText(5)
lcc_us = arcpy.GetParameterAsText(6)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[1] = "srce"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[2] = "rvrnme"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[3] = "rvrtyp"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[4] = "drns"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[5] = "fr_main_riv"
            cursor.updateRow(row)

with arcpy.da.UpdateCursor(fc, fields) as cursor:
    for row in cursor:
        if  row[0] == "f_id":
            row[6] = "lcc_us"
            cursor.updateRow(row)

Once I have made the necessary edits and ran the script tool wizard the script doesn't work. The detail box states that the scrip has completed and that it was successful, but non of the specified edits have been occurred and only a blank space remains. The above makes me think that the problem lies in the script tool wizard, specifically the data types and parameter properties I am using.

Can anyone suggest any changes I can make to the the script tool wizard or the amended script?


texts: Specifying minimum cluster size with OpenLayers 3 Clustering?

texts:
With OpenLayers 3, how can I specify a minimum cluster size so that clusters with 5 map markers or less will not get clustered, but will instead display the individual map markers?

Is there a way to do this within the cluster layer's ol.layer.Vector object?

let clusterLayer = new ol.layer.Vector({
source: source,
style: function(feature, resolution) { }
});


texts: Image Pyramid + Geoserver + Google Earth slow with errors

texts:
I have hundreds of GB of somewhat small tif files. Here is gdalinfo of one of them:

F:\gis\geotiffs>gdalinfo finaloutputSSAM211Jun181306hfwaterfall0.tif
Driver: GTiff/GeoTIFF
Files: finaloutputSSAM211Jun181306hfwaterfall0.tif
Size is 2281, 4301
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
        AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-85.749319836621979,30.000952072441574)
Pixel Size = (0.000000303816798,-0.000000303816798)
Metadata:
 AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
 Corner Coordinates:
Upper Left  ( -85.7493198,  30.0009521) ( 85d44'57.55"W, 30d 0' 3.43"N)
Lower Left  ( -85.7493198,  29.9996454) ( 85d44'57.55"W, 29d59'58.72"N)
Upper Right ( -85.7486268,  30.0009521) ( 85d44'55.06"W, 30d 0' 3.43"N)
Lower Right ( -85.7486268,  29.9996454) ( 85d44'55.06"W, 29d59'58.72"N)
Center      ( -85.7489733,  30.0002987) ( 85d44'56.30"W, 30d 0' 1.08"N)
Band 1 Block=2281x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=2281x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=2281x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=2281x1 Type=Byte, ColorInterp=Alpha

I used gdal_retile.py with the following command line:

gdal_retile.py -v -r bilinear -levels 4 -ps 2048 2048 -co "tiled=YES" -targetDir pyramid --optfile files.txt

I then create an Image Pyramid store in Geoserver and set multithreading to true, and USE_JAI_IMAGEREAD in the layer. When I go to Layer Preview and click on KML it opens in Google Earth. When I zoom in, it takes a very long time to render, and sometimes it times out and gives me various errors.

Currently I built the Image Pyramids with only 30 or 145 of those tifs to see if maybe it was because my data set was so large, however I get the same performance with those smaller sets.

What am I doing wrong?

Here is a picture of one error I am getting:

http://i.imgur.com/HHjzu.jpg

I also get an error that just says "Error when parsing file"

Thanks!


texts: FME: How to retain Field names in reader?

texts:
I am having problems with field names in my writer using fme 2014. When I "generate" a workspace and pre-define the reader and writer before I add transformers, the readers field names are automatically retained by the Writer. However, when I create a blank workspace and add the reader and writer separately, the field names are not migrated to the writer unless I use "dynamic schemas" - But in this case, the fields are not visibile in the dropdown list under the Writer, and under properties I can´t delete the attribute fields that I don´t want. Even if I deactivate them in the reader, they are still retained by the writer!

How can I get more control over which attribute fields get written to the writer?


texts: How to Simulate Venn Diagram of Buffers using QGIS?

texts:
For the sake of simplicity, suppose I have only 2 points on one layer. Point A have population of 100, and point B have population of 150. I do find buffer of these 2 points and it is intersect. I want the intersect buffer (polygon C) to have number of people from A and B, according to the area of intersection. While polygon L and R, which is not intersect, have number of people minus amount of people they sent to the intersect buffer, like this

My real data using polygon instead of point, and there is about 10 of them. How do I simulate this efficiently in QGIS?

Idea #1

Random filling each buffer with points according to the number of its population. Then create heatmap from these points (why can't we create heatmap from polygon, by the way?) This method might not good enough since I want result as vector data, to let me able to use it in calculations furthermore.

Idea #2

Find area of each buffer polygon. Calculate population / area and store to column pop_ratio.
Split buffer layer (now it is polygon L, R).
Intersect polygon L and R to get polygon C. Calculate summation of pop_ratio then calculate sum_pop_ratio * area to retrieve population of polygon C.
Difference polygon L/R with polygon C. Calculate pop_ratio * area to retrieve population for each polygon as well.

But my data might form ups to 20 intersect polygon, which obviously not so much enjoy to do this by hand.


texts: Creating Quadtree/Space Filling Curve Index atop GeoTiFF

texts: I'm a complete beginner in GeoTiFF manipulation. I'd like to get some help in possible Java/Python/Scala project which performs spatial indexing (Quadtree, Space Filling Curves) atop given image(s). I intend to store these images in a database along with the spatial indexes calculated for subsequent retrieval. Would be glad if I could get a head start. I already became aware of GeoTools, Apache Commons Imaging like libraries. At the moment I'm trying to get familiar with the libraries. Would like community's help in finding more libraries/ tools projects.


texts:
Having hard time on how to geotagged photos on the reprojected shapefile. I have these photos and waypoints with GCS_WGS_1984 projection, in which coordinates are on decimal degrees. In this projection, I can still see the geotagged photos in its respective waypoints.

But when I reproject the shapefile (waypoints) from GCS_WGS_1984 to WGS_1984_UTM_Zone_51N, my problem starts here.

I can't view the respective photos in its points.
Do I still need to reproject the coordinates of the photos? If so, how to reproject this?


texts: Restructure data.frame By Date Values in R

texts:
I have a data.frame in R shown below..

This data.frame summarizes counts by week for every year in a time series dataset.
I am now trying to rearrange this matrix such that the years (2001-2020) will be the columns, the weeks (1-52) will be the rows, and the sumweek column is the data that I would like to use to fill in the matrix.
Is there an easy solution for this?


texts:
I am building GDAL from source to limit the list of supported drivers however I cannot find a definitive list of formats and their appropriate shorthand names to use in my ./configure list to set them to without

I have found https://trac.osgeo.org/gdal/wiki/BuildingOnUnixWithMinimizedDrivers but I don't think this is the full list.

In release 3 there is now a version to build without all the optional drivers using --disable-all-optional-drivers but even using this still gives me a number of drivers for example MapInfo and TopoJSON that i do not want to include.


texts: Reference ObjectID in a where clause within an UpdateCursor

texts:
I have a dynamic list of ObjectID values I need to filter an UpdateCursor on.  I am setting a where_clause as:

where_clause_points = "[ObjectID] IN({0})".format([x for x in inspected_points])

Which produces a string something like:

[ObjectID] IN([87, 88, 89, 90])

I then use this where clause in an UpdateCursor to update only the features in that list of ObjectID's:

with arcpy.da.UpdateCursor(lines_backup, fields, where_clause_points) as cursor:
    for row in cursor:
        row[1] = 'processed'
        cursor.updateRow(row)

But this produces the error:

...RuntimeError: Attribute column not found [42S22:[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid column name '87, 88, 89, 90, 91, 92'.]...

or if using some other value for ObjectID:

RuntimeError: Attribute column not found [42S22:[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid column name 'OID'.]

Any sort of value I use for ObjectID (OBJECTID, OID, OID@, etc.) throws a similar error.

How can I reference the ObjectID in this where clause where the value is variable and in a list of possible values?

Environment:
Python 3.6.5 (stand alone script)
ArcGIS 10.6
Microsoft SQL Server db


texts: Getting raster image as array in Python with ArcGIS Desktop?

texts:
When starting to work with Python and ArcGIS 9.3, I assumed there would be a simple way to get a raster image into a Python array so that I can manipulate it before storing it back as another raster image. However, I can't seem to find out how to do this.

If it is possible, then how?


texts: Merging OD Cost Distance Matrix result from ArcGIS Network Analyst in ArcPy?

texts:
Using ArcGIS 10 Network Analyst, I've created small python script that calculates OD matrix between certain locations, i.e. not between each origin and destination but for each origin I have a set of destinations that I want to calculate routes for. I end up with 17 results saved as a .lyr file (don't necessary need to save them on hard drive as such). I would like to merge those results together. The problem is a OD Cost Matrix Layer is in fact a group of layers and I'm only interested in layer Lines.

To sum up: if layer is OD Cost Matrix Layer (group of layers) and Lines is one of the layer in that group and I want to use Merge tool to merge a few of such Lines layers - how do I do it as

arcpy.Merge_management(layer, output)

is obviously giving me an error of input not being a table view.


texts:
I have been stuck with this problem for days.

Some other department in my company created a map using MapInfo/MapXtreme. They have published a Tile Map Service. The Tile Map Service accepts SOAP requests and returns an XML that contains base64string of a tile image based on the parameter given (TileX, TileY and (zoom) level).

How do I embed a web map viewer (like google maps) using this service?


texts: Geopackage is not visible in QField offline editing mode

texts:
I am using QGIS 3.4.9 Madeira and QField 1.4.4.
Having a gpkg and shp layer with the same information in a project and transferring them both to QField (both layers are set to offline editing), only the shapefile layer is visible. The gpkg file is not visible.

Although gpkg file is not visible, it is editable! When I add a polygon, I see the new polygon in QField with the symbology as set in the QGIS project.
I have the same issue with a line layer, but not with a point layer
When using QFieldSync, the plugin asks me always: "do you want to save the changes in the layer Survey_V_Vlakken (offline)"? In other words, it seems that QFieldSync makes a new layer for mobile/offline use?
Synchronizing back with QField, the changes in the gpkg and shp layers are added to the QGIS project
First I was using a *.QGZ project (as the default in QGIS 3.4) but I also tried *.QGS and is does not make any difference.
Both layers have the same CRS 31370 (Belgian Lambert)

Does anyone knows how I can make the gpkg file visible? In a similar question somebody added the same gpkg file as a copy for the QField project; in that way it was visible. But this is not a very handy solution...

Link so similar question


texts: Convert polygon symbology to point symbology?

texts:
I created an elaborate polygon symbology to display different plant species in ArcMap 10.4 using different colors and dotted borders.

Is there any possible way I can apply this symbology to point features?


texts:
i am looking for a method by which i can export fc list and fc count into xls or csv. for example i have 3 featureclass in Scratch.gdb.

1.PaLakh

2.PATest1

3.Point

i want all 3 of these featureclass name to be exported into a csv or xls. also the feature count of every featureclass against featureclass name.

i tried the below mentioned code, but instead of exporting fclist it exports every character of fc into a new row like.

p

o

i

n

t

import csv, arcpy, os
 from arcpy import env
 env.workspace = r"C:\Akhil_Office_1\Python\ToolBox\Scratch\Scratch.gdb"
 fclist = arcpy.ListFeatureClasses()
 for fc in fclist:
  csv_out = open(r'C:\Akhil_Office_1\Python\ToolBox\Scratch\test.csv', 'wb')
  mywriter = csv.writer(csv_out)
  rows = zip(arcpy.env.workspace, fc)
  mywriter.writerows(rows)
  csv_out.close()

or is there any other way in arcpy to export feature class name list into xls ?


texts: Using Arcpy to Turn on Maplex Label Engine

texts:
I've been attempting to automate a number of processes into one script using arcpy. I've got everything working and am wondering if there's a way to use arcpy to toggle on/off the Maplex Label Engine.

So far I haven't been able to find an appropriate answer. Has anyone been able to accomplish this?


texts: Use Vertical Mapper Grid file in GeoServer

texts:
I have coverage plot in Vertical Mapper grid format and I want to create a store using it in GeoServer.

QGIS can read the grid file and shows a nice plot. My grid file has 4 bands, possibly RGB and data.

I converted the grid file to ASCII Grid using gdal_translate using band 4. Now data could be loaded into GeoServer but it is not showing anything.

Is there any extension for GeoServer which can help me load this data in GeoServer.


texts: How do I install the GDAL bindings for C#/.NET 4.5.1?

texts:
I'm trying to use the C# gdal bindings but I get an error in my C# code which says "Unable to load DLL 'gdal_wrap': The specified module could not be found. (Exception from HRESULT: 0x8007007E)".

I've had a look at the dependencies for gdal_csharp.dll and everything looks okay. Two things that stood out though were that the csharp dll is a 32 bit dll, while all the dependencies are for a 64 bit system (my machine has a 64 bit CPU). Also, the file ieshims.dll was listed as a dependency, but from what I gather, it isn't strictly necessary that it be installed.

I've tried installing the files manually via a zip file and also using the .msi installer for the gdal core libraries. I made sure to add the paths to the gdal executables to my system path.

I downloaded the binaries from here:
http://www.gisinternals.com/query.html?content=filelist&file=release-1800-x64-gdal-1-11-1-mapserver-6-4-1.zip

And I roughly followed this guide for installation instructions:
http://vipassanaandenvironmentalinformatics.blogspot.co.nz/2013/03/getting-started-with-c-and-gdal.html

I'm using Visual Studio 2013, for which the binaries are available on the site above.


texts:
I have several layers in my workspace, stored in postGIS. If I go to "preview layers", it will work OK, not tiled though.

I need it to be tiled for my app, so I have it activated in all my layers, and as such, every one of them is shown in "Cached layers", but if I try to preview them, it's just an empty canvas. If I do a GET petition from my app, it works but it's just empty.

I've got my suspicions but WMS service is OK as normal layers work.

Any idea?


texts: Pre-trained transfer learning models for satellite image classification

texts: I am currently working on a project that tackles crop type classification using machine learning and deep learning. Given the limited amount of satellite data that I have, transfer learning sounds like the next best option. I was wondering how can I find pre-trained models?


texts: ST_ApproximateMedialAxis producing strange outputs

texts:
My problem is as follows: I have some lines (yellow), that I want to merge in one line if they are at a certain distance (blue, buffer), and after a long research I found this function from PostGIS/SFCGAL. The output are the red lines. It kinda does the job, but it makes a strange angle when it joins the lines that I would like to get rid off. The function does not have parameters to tweak, so I wonder what else I could do. I do not want the skeleton, which I could find some help here, cause I dont want the line to be touching the borders of the buffer.

I work with python mainly, but open to suggestions.


texts:
I got GeoServer up and running today and created a store that is linked to my postgis database, with a layer corresponding to one of the tables in the database. I then previewed the layer using the GeoServer Layer Previewer and it all worked nicely.

I began messing around with GeoServer, trying to get this layer plotted on my own OpenLayers map, and now none of the layers work in the Layer Previewer. When I click "go", a new tab opens with a blank box where the map should be, and the tab indicates that it is loading. However, it does not ever appear to load correctly.

Does anybody have any idea what I might have done to mess this up?

Thanks,

-Rob


texts: How can I check if all boundaries of a polygon coincides with one or more of a set of lines

texts:
I have a polygon shapefile, and theoretically, all features in the shape are bounded by the union of some lines in another shapefile.
Is there any way to confirm if this is true?

I'm using QGis, FME and PostGIS, but don't know tools for doing it in any of this softwares.
I've tried to use FME's SpatialRelator, but couldn't find a check that assesses this situation.


texts: ArcGIS Javascript API - Add Labels with no symbology to graphics layer

texts:
Is it possible to create a feature layer that has no graphics, except for labels?

The idea is that I've already got my layer drawn from a dynamic layer type, and don't want to cover up that symbology, I only want to add labels.

This is what I have so far, but it is using the symbology defined for the layer, which I would rather have it use no symbology.

  var serviceURL = this.activeLayer.layer.url + '/' + this.activeLayer.subLayer.id;
  var layerOptions = {
      mode: FeatureLayer.MODE_ONDEMAND,
      outFields: ['*'],
      id: layerId,
      visible: true
  };

  var layer = {
      layer: new FeatureLayer(serviceURL, layerOptions),
      iconNode: this.activeLayer.iconNode
  };
  this.map.addLayer(layer.layer);

var renderer = new SimpleRenderer({
    colors: this.colors
});
var label = new LabelClass({
    labelExpressionInfo: {
        value: '{' + this.activeField + '}'
    },
    useCodedValues: true,
    labelPlacement: 'above-center'
});
var symbol = new TextSymbol();
symbol.font.setSize('10pt');
symbol.font.setFamily('Corbel');
symbol.setColor(new Color(this.activeColor));
label.symbol = symbol;

layer.layer.setLabelingInfo([label]);
layer.layer.setVisibility(true);


texts:
I am trying to extract the endpoint of a line with very fine scale and overlapping GPS data. I would normally just use the locn_id+1 but that doesn't work because the data were originally rarified. Likewise, spatial joins don't work because of the overlap.

I figure the best way to do this is to go back to the point file, create a column "End_id" and populate it with the next row's locn_id. I want to do this in Python, but I'm very new with update.cursor and can't figure it out.

Sadly I haven't gotten very far with a couple hours of looking around...

## fields to be added
Endid = "End_id"
Startid = "locn_id"

print "Adding column End_id"
arcpy.AddField_management(fc, Endid, "LONG")
print "Adding nrow+1 locn_id to End_id"
with arcpy.da.UpdateCursor(fc, Endid) as cursor:
    for row in cursor:
        cursor.updateRow(row)


texts: GeoServer ImageMosaic doesn't handle internal mask for JPEG compression GeoTIFF

texts:
Following my question here, I am publishing some GeoTIFF with JPEG compression and internal mask.

It works as expected when I publish the image under a GeoTIFF store but doesn't when I publish from an ImageMosaic store.
Here are the previews rendered by GeoServer:

My first thought was that the ImageMosaic wasn't using the same driver as the GeoTIFF store publishing. So I tried to change the SuggestedSPI in the ImageMosaic .properties file from it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi to  it.geosolutions.imageio.plugins.geotiff.GeoTiffImageReaderSpi

But GeoServer fails to create such store with a suggestedSPI that is not the default TIFFImageReaderSpi.

I didn't find much documentation on changing the suggestedSPI, does anyone know why the GeoTiffImageReaderSpi doesn't work? Or any other ideas for having the same rendering on ImageMosaic as the GeoTiff store?

Here is a sample of the file if needed : https://www.dropbox.com/s/hz6j0m0ck2txncj/sample_jpeg_compression_internal_mask.tif?dl=1


texts: Specifying region of interest for google earth engine to calculate Jeffries-Matusita separability?

texts:
My objective is to compute Jeffries-Matusita separability using google earth engine python api. I have never worked with ee before, so I am trying to follow this github.
In it, to import roi it says:
table = ee.FeatureCollection('users/mortcanty/supervisedclassification/train')
trainData = image.sampleRegions(table,['CLASS_ID'])

What surprised me here is that the file here has no extension. So I tried to use shp (and only shp,not its supporting files).
However, subsequently when I try to parse 'table' in this function
def jmsep(class1,class2,image,table):
# Jeffries-Matusita separability
    table1 = table.filter(
        ee.Filter.eq('CLASS_ID',str(class1-1)))
    m1 = image.reduceRegion(ee.Reducer.mean(),table1)\
              .toArray()
    s1 = image.toArray() \
         .reduceRegion(ee.Reducer.covariance(),table1)\
         .toArray()
    table2 = table.filter(
        ee.Filter.eq('CLASS_ID',str(class2-1)))
    m2 = image.reduceRegion(ee.Reducer.mean(),table2)\
              .toArray()
    s2 = image.toArray() \
        .reduceRegion(ee.Reducer.covariance(),table2,15)\
              .toArray()
    m12 = m1.subtract(m2)
    m12 = ee.Array([m12.toList()]) # makes 2D matrix
    s12i = s1.add(s2).divide(2).matrixInverse()
#  first term in Bhattacharyya distance
    B1 = m12.matrixMultiply(
          s12i.matrixMultiply(m12.matrixTranspose())) \
            .divide(8)
    ds1 = s1.matrixDeterminant()
    ds2 = s2.matrixDeterminant()
    ds12 = s1.add(s2).matrixDeterminant()
#  second term
    B2 = ds12.divide(2).divide(ds1.multiply(ds2).sqrt())\
             .log().divide(2)
    B = ee.Number(B1.add(B2).project([0]).toList().get(0))
#  J-M separability
    return ee.Number(1).subtract(ee.Number(1) \
             .divide(B.exp())) \
             .multiply(2)

a = jmsep(5,9,image,table).getInfo()

Gives error:

Collection asset 'C:\Users\train.shp' not found

I suspect this is due to 'shp' file not being appropriate.


texts:
For creating a legend of a map, I need to get a list of unique values over multiple attribute columns of a layer. I know how to get a list of unique values within one column - is it possible to get a list of unique values over multiple columns?

Example:
Polygon 1: Field 1: x, Field 2: a, Field 3: b

Polygon 2: Field 1: a, Field 2: c, Field 3: z

Polygon 3: Field 1: x, Field 2: b, Field 3: z

Now I need a list with the values that are unique over the fields 1, 2 and 3. For the example that would be x, a, b, c, z.

I am using QGIS Version 2.14.1


texts: Automatic numbering of rows in attribute table - QGIS

texts: In my attribute table, I have districts and cities for Finland as shown in the picture below. Is there a way I can give a number to each city without doing it manually?


texts: I have thirteen polygon layers showing species at risk ranges - I have a standard arc GIS desktop license, allowing only two inputs to the intersect/union tool at one time.  I need to create a "hot spots" layer showing where the ranges overlap. I need more than a polygon where all 13 layers intersect though, I need all types of overlap, ex. showing where two ranges overlap and three layers overlap etc.  I feel like there is probably some way to do this via multiple intersect/union but I can't wrap my head around it.  Alternatively I could merge all layers into one polygon files, and intersect it by itself - but then I can't figure out how to combine overlapping polygons into one with all attributes intact.


texts:
I am getting the following error when attempting to upload data to QGISCLoud using QGIS 3.10:

local variable 'hexstr' referenced before assignment

Has anyone seen this before and able to point me in the right direction?

Full error log below:

Traceback (most recent call last):
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 975, in upload_data
    self.data_upload.upload(self.db_connections.db(unicode(db_name)), data_sources_items, unicode(self.maxSize))
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\data_upload.py", line 254, in upload
    RasterUpload(conn,  cursor,  raster_to_upload,  maxSize,  self.progress_label)
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\raster\raster_upload.py", line 113, in __init__
    gt = self.wkblify_raster(opts,  infile.replace( '\\', '/') , i, gt)
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\raster\raster_upload.py", line 720, in wkblify_raster
    summary = self.wkblify_raster_level(options, ds, options['overview_level'], band_range, infile, i)
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\raster\raster_upload.py", line 666, in wkblify_raster_level
    hexwkb += self.wkblify_band_header(options, band)
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\raster\raster_upload.py", line 561, in wkblify_band_header
    hexwkb += self.wkblify(self.pt2fmt(pixtype), nodata)
  File "C:/Users/Frank/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\raster\raster_upload.py", line 494, in wkblify
    return hexstr
UnboundLocalError: local variable 'hexstr' referenced before assignment


texts: Deriving input based on other parameters in Python script tool?

texts:
I have a folder and it contains two feature classes, e.g., a.shp and b.shp. The script tool created has two parameters. The first one is the model location, and the second one needs a feature class (a.shp), as shown in the below picture.  What I really want is every time when I set up the model location for the first input, the second input will automatically find the a.shp as the input rather than the user needs to choose a.shp from that folder. I noticed that the dependency is probably what I really need, but there is no code example. Any suggestions?

I am using ArcGIS 10.3.1 Advanced License.


texts: Embedding HTML5 video in ArcGIS Story Map Series?

texts:
It appears that the Story Map Series only allows an iframe for inserting videos. Although, I cannot use YouTube or other hosting services so the link is directly to the video instead of a video host. I would like to simply embed HTML5 instead, which I attempted below.

First I created the html file containing this:

<video controls="controls">
    <source src="url_to_my_video.mp4" type="video/mp4">
</video>

Then I included the following iframe in the story map.

<iframe src="url_to_my_file.html" />

The video never appeared. Any ideas?


texts: qgis to local postgis connection - fails

texts:
It seems pretty clear I cannot connect to a local postgresql installation out of QGIS. This is my first experience with PostGIS.
I am using PostgreSQL 9.0 on a win7 machine. I can see the successful installation of Postgresql and the postgis database in both PGAdmin and NaviCat. I have added a user account in PGAdmin which is not a superuser (meaning I believe I have dealt with the issues discussed at http://pgsnake.blogspot.com/2010/07/postgresql-passwords-and-installers.html).

Has something changed on QGIS 1.7?

After I choose to Add Postgis Layer, I specify a new connection which resembles my configuration and is consistent with http://www.gistutor.com/quantum-gis/20-intermediate-quantum-gis-tutorials/34-working-with-your-postgis-layers-using-quantum-gis-qgis.html and the Linfinity blog. I have toggled SSL mode after reading http://osgeo-org.1803224.n2.nabble.com/Postgis-SSL-connection-td2037146.html.

The failure in the test connection leads to "ERROR:service file "/etc/pg_service.conf" not found".

Has anyone got some more positive experience with PostgreSQL, QGIS and Win7?


texts: Road segments reconstruction from GPS trajectories

texts:
We have a 10,000 base of vehicle mounted moving devices which report their GPS position on a time based schedule. All that data is currently being stored in our database for several business related purposes. We think It could also provide us a base for building our own maps, but we really don't know how could this be achieved.

There must be some way to aggregate individual data points (coordinates) into line segments, thus making streets.


texts: Is there a way to export QGIS layers to KML?

texts:
has had anyone had any luck with the new experimental plugin qgis2kml?
 I keep getting the error msg  layer : format not yet supported

I had a look but the author has not provided any documentation, although I can't access the author's homepage at the moment.
I tried different projections, but other parts of the error message refer to symbology.


texts:
I am not a "computer person". So -- I don't know what this error message means. I found this question and answer for this same problem, but the solution did not work for me, dammit.
GRASS algorithm r.los does not produce raster

I am using QGIS 2.0 (or maybe 2.0.1?). The computer is running Windows 7.
I activated the menu Processing > Commander and got the command entry line above the map-area window -- no problem there. (The QGIS project I'm using has an elevation raster.)
The computer program picks up just fine that I want to use the loaded raster.
I copy and paste my coordinates for viewer location just fine.
I tried leaving the default, temporary output file, and I also tried creating and entering into the GUI form a new file for this process. Each time, the following error message resulted.

Oooops! The following output layers could not be open
Output raster layer: C:/Users/Cogreg/Documents/GIS, QGiS/Files_Greg_created_via_GIS/300_CountyRd_41_viewshed.tif
The above files could not be opened, which probably indicates that they were not correctly produced by the executed algorithm
Checking the log information might help you see why those layers were not created as expected
This algorithm requires GRASS to be run. A test to check if GRASS is correctly installed and configured in your system has been performed, with the following result:
GRASS seems to be correctly installed and configured


texts: Why are QGIS field calculator statements (both IF and CASE) giving strange results?

texts:
Using the field calculator, I'm trying to update an attribute only if it equals to zero:

CASE WHEN  "Z" = 0
THEN
"Z" =  rand(1,100)
END

This let the 0 values as they are and updates all others to "NULL".

This IF statement doesn't work either:

IF( "Z" = 0,
"Z" = rand(1,100),
"Z" = "Z"
)

It sets all values greater than zero to 1 and let the others = 0.

What's wrong with these statements?
Z is a double.
I clicked all functions and element in the search list so there shouldn't be any typo.

And what kind of language is this, I can't recognize SQL; it seems to be some kind of "internal to QGIS language".


texts: Overlay rasters from 2 different coordinate systems

texts:
I'm trying to overlay SAR (10m-res) and IFSAR (5m-res) rasters.

I tried to project both using the PROJECT RASTER function of ArcGIS to the same coordinate system, but they won't overlay properly.

The SAR was said to be originally in WGS84 while the IFSAR was in PRS92.

I do not have access to their "original" state and I am not sure how many transformations the data have undergone which is what I think is causing my dilemma.

When I received the data, the SAR was already in WGS_84_UTM_Zone_51N with datum of D_WGS_1984 while the IFSAR was already in UTM_Zone_51_North_Hemisphere with datum D_Philippine_Reference_System_1992.

How can I overlay these without manually pulling/georeferencing the rasters?


texts: How to find which subtype using which domain?

texts: I'm trying to delete domain, but i can't because it is in use at an attribute domain. How can I find out at which layer and which subtype ? I have a big geodatabase with more than 30 layers an each one have few subtypes ?