texts: Rotating features generated by the geometry builder

texts:
In QGIS I have a point feature with "Rotation" field. Using the geometry builder I am trying to build square geometries based on the XY as centre and rotated based on the "Rotation" field using the expression below.

geom_from_wkt(
'POLYGON(('||
(((x( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation"))))-((y( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation")))))||' '||(((x( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation"))))+((y( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation")))))||','||
(((x( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation"))))-((y( centroid( $geometry) ) - 0.5)*(sin(radians("Rotation")))))||' '||(((x( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation"))))+((y( centroid( $geometry) ) - 0.5)*(cos(radians("Rotation")))))||','||
(((x( centroid( $geometry) ) - 0.5)*(cos(radians("Rotation"))))-((y( centroid( $geometry) ) - 0.5)*(sin(radians("Rotation")))))||' '||(((x( centroid( $geometry) ) - 0.5)*(sin(radians("Rotation"))))+((y( centroid( $geometry) ) - 0.5)*(cos(radians("Rotation")))))||','||
(((x( centroid( $geometry) ) - 0.5)*(cos(radians("Rotation"))))-((y( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation")))))||' '||(((x( centroid( $geometry) ) - 0.5)*(sin(radians("Rotation"))))+((y( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation")))))||','||
(((x( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation"))))-((y( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation")))))||' '||(((x( centroid( $geometry) ) + 0.5)*(sin(radians("Rotation"))))+((y( centroid( $geometry) ) + 0.5)*(cos(radians("Rotation")))))||','||
'))')

My rotation values are in degrees hence the conversion to radians but any feature with a rotation does not show up at all, features with no rotation value set show up as squares aligned North to South. Can someone tell me where I went wrong?


texts: How to pass parameters to Geoserver Heatmap SLD

texts:
I am trying to generate heatmap using Geoserver Transformation SLD. as mentioned on the page, It requires few parameters:

data
weightAttr
radiusPixels
pixelsPerCell
outputBBOX
outputWidth and
outputHeight

I am able to use it by specifying these parameters directly in SLD as default parameters. But I am not able to pass it as OpenLayers request. There is my code:

    var layer = new OpenLayers.Layer.WMS("Heat Map",
      "http://port/geoserver/wms",
      {
        layers: 'work:cbsa_pop',
        format: "image/png",
        transparent: "true",
        styles:'heatmap',
        maxExtent: new OpenLayers.Bounds(-124.269,32.545,-114.354,41.956),
        projection: new OpenLayers.Projection("EPSG:4326"),
        data:'data_attr',
        weightAttr:'w_attr',
        radiusPixels:100,
        pixelsPerCell:100,
        BBOX:new OpenLayers.Bounds(-124.269,32.545,-114.354,41.956),
        outputWidth:1000,
        outputHeight:1000
    });

This way it is not accepting any of the parameter. Any guidance will be helpful.


texts: Extracting difference between two shapefiles (not symmetrical difference) using ArcGIS Desktop?

texts:
I have a shapefile with polygons that portray survey areas (Pink areas in picture below).

I receive a new updated shapefile with additional survey areas, and thus new polygons (Green areas in picture below)).

Every polygon has a unique source ID. I want to compare the source ID attribute tables between the original and the updated shapefiles, in order to extract the difference (see below)

I want it to result in a new shapefile with only differing polygons (Green areas in picture below).

How do I accomplish this using ArcGIS Desktop?


texts: I have downloaded several Sentinel 2 granules, with single bands raster data in .jp2 format, and I want to create true and false color composite images out of them. Using ArcGIS I could not open any single band raster (error says "invalid dataset"). Using QGIS I can open them but I cannot composite (I have tried using both "merge" and "create virtual raster" tool). I also tried to convert into geotiff using python scripts, but I am not that good in python, thus it did not work and probably I would need step by step guidance to do that. Does anyone have some ideas to solve the problem?


texts: How to convert Lat, Lon, Alt to ECEF and EPSG 4979?

texts:
I am programmatically generating data to use in Cesium's 3D Tile System. The data I have is in (Latitude, Longitude, Altitude) format. To display the data in Cesium, I have to first define a region to render the data in, and for that I am trying to use a region. However, I do not understand what the values they use to define their North, East, West, South. I try to use the following line of code to transform my data, which is in EPSG 4326, to EPSG 4979, but it spits out the same values:

> gdaltransform -s_srs EPSG:4326 -t_srs EPSG:4979
-134 47
-134 47

I am using Python's GDAL bindings, and I need to do two things:

Convert (LAT,LON,ALT) to Cesium's ECEF co-ordinate system (X,Y,Z) to display the objects at the right position.
Convert the edges of my dataset to a region that Cesium's tileset.json will understand. Here's my dataset format:

GDAL_INFO:

PROJCS["unnamed",
    GEOGCS["Coordinate System imported from GRIB file",
        DATUM["unknown",
            SPHEROID["Sphere",6371229,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",38.5],
    PARAMETER["standard_parallel_2",38.5],
    PARAMETER["latitude_of_origin",38.5],
    PARAMETER["central_meridian",262.5],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Metre",1]]
Origin = (-2699020.142521935515106,1588193.847443337785080)
Pixel Size = (3000.000000000000000,-3000.000000000000000)
Corner Coordinates:
Upper Left  (-2699020.143, 1588193.847) (134d 7'17.14"W, 47d50'44.64"N)
Lower Left  (-2699020.143,-1588806.153) (122d43'44.80"W, 21d 7'19.89"N)
Upper Right ( 2697979.857, 1588193.847) ( 60d53'28.48"W, 47d50'57.51"N)
Lower Right ( 2697979.857,-1588806.153) ( 72d16'48.48"W, 21d 7'28.62"N)
Center      (    -520.143,    -306.153) ( 97d30'21.52"W, 38d29'50.09"N)

How do I go about achieving this?

Just to add some more information, my source dataset coverts CONUS. And my playing around with the values, this is an approximate tileset "region" that covers that area:

"region": [
        -2.2197004795898053,
    0.488582109,
    -1.2196595204101946,
    0.7988897891,
    0,
    300000
    ]
}


texts: How to automatically separate two pins when a map is scaled in Carto

texts:
I am building a map on Carto, i am mapping activities at building level in a city. Sometimes two activities occur in the same building, when the map is zoomed in (at building level) you can clearly see the different icons but when I zoom out the icons collide and you can finally see one only (others are masked behind).

I wonder if there is a way to automatically separated the icons when the map is scaled in order to keep the readability of each individual icon? Any ideas?


texts: Adding points every X distance along a LineString

texts:
I have a list of LineString coords:

 list = [(90, 170), (99.0, 159.0), (321.0, 159.0), (300, 146), (296, 23)]

which looks like this.

How to interpolate a point at every X distance along the line using Shapely?


texts:
how do I get php to connect automatically to GeoServer?? so I do not need to go into GeoServer manually by entering the username and password.
And how to queries on PostGIS can directly publish and request layer from GeoServer?

-thanks for answering-


texts:
I'm trying to have a user input a county in my tool, and then use that string to select from a layer of counties.

County = arcpy.GetParameterAsText(0)
#Select county to clip
arcpy.MakeFeatureLayer_management ("W:/Homework117/Final Project -- B&B/Data/FinalProject.gdb/WestCoastCounties", "countieslyr")
arcpy.SelectLayerByAttribute_management ("countieslyr", "NEW_SELECTION", '[NAME] = County')
x = arcpy.CopyFeatures_management("countieslyr", "CountyOfChoice")

The SelectLayerByAttribute process produces the following error:

Traceback (most recent call last):
  File "W:\Homework117\Final Project -- B&B\PythonCode\FirstCode.py", line 29, in <module>
    arcpy.SelectLayerByAttribute_management ("countieslyr", "NEW_SELECTION", '[NAME] = County')
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 7221, in SelectLayerByAttribute
    raise e
ExecuteError: ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute).


texts: Creating flt (floating point raster) with QGIS

texts: I would like to create a flt (floating point raster) with QGIS to use later as a terrain in Hec RAS RAS-Mapper. With Raster -> Conversion -> Translate there is no option to create a flt. Is there another way?


texts:
I have a plan of a building, drawn to scale in Corel Draw.
The whole drawing was 'surveyed' using the principal of taking distances from of each of these 2 points to identify the location of a 3rd point - triangulation I think its called.
I have spacial references for the 2 fixed and known points - not 3. If I had 3 points I could easily geo-ref a bitmap layer from the drawing, but I don't have that luxury.

How can I add this drawing?

When replying please consider I am really new to QGIS.

Thanks


texts: Calculate intersection of two 3D vector polygons


texts: which method is appropriate for interpolating temperature data in ArcGIS?

texts: I am doing a study on urban heat island where i have to study the atmospheric heat island. there are 20 thermo-hygrometers kept at different locations within a city. daily 4 times the readings are taken i.e early morning, morning, afternoon and night. i want to interpolate the data in arcgis so can you please guide me which method will fit best for the same. i want to compare the results seasonally.


texts: Labels not rendering properly with OSM Bright style on Openlayers using Tileserver

texts:
Referring the document at Tilerserver I am using my local tileserver-gl-light but my label are not rendered correctly. Label appears as {name:latin}{name:nonlatin} or {name:en}{name:nonlatin} refer the screenshot

This happens only when I change the style to http://localhost:7070/styles/osm-bright/style.json whereas If using the default https://openmaptiles.github.io/klokantech-basic-gl-style/style-cdn-undecorated.json it works fine.

Am using ol v4.3.1 and olms.js v2.6


texts: Calculate cumulative distance for route using PostGIS

texts:
The route shown below represents the mobile signal strength for a route thats been driven. The red dots are poor signal, yellow dots fair signal etc. The data is stored in a postgres table and is geo-coded using lat & long.
Its required to calculate the total distance per category i.e. what distance was driven where signal is poor, fair etc.
Is there a mechanism in PostGIS to bin the segments and sum them?

EDIT (supplied data as requested):
The data currently is currently as follows. There aren't any GIS types.

ID
Lat
Long
Time
Signal Strength

long
double
double
string
string

1
4.13883879
11.52922145
15:04:00.500
Poor

1
4.13873610
11.52914528
15:04:02.500
Poor

1
4.13819539
11.52914528
15:04:04.500
Fair

1
4.13793128
11.52870903
15:04:06.500
Fair

1
4.13755825
11.52861072
15:04:08.500
Poor


texts: How to export Select By Location result to Excel using Python and ArcPy?

texts:
I have been using ArcGIS for a few years now but have only started using Python scripting for ArcGIS for a month or so. I am trying to create a script and I am having a hard time trying to get it to work (Error after Error).
In ArcGIS, I have used SELECT BY LOCATION and exported the selected records as a dBASE table into my file. I have been able to create the Python script to help me do this and also to convert it into an Excel file.

import arcpy

fc = 'Z:\\GIS TEST\\Codes\\Codes\\K.Dun\\Export_Output_2.dbf'
CSVFile = 'Z:\\Excel.csv'

fields = [f.name for f in arcpy.ListFields(fc)]

for i,f in enumerate(fields):
    if f == 'Shape' or f == 'Shape_Length' or f == 'OBJECTID':
        del fields[i]

with open(CSVFile, 'w') as f:
    f.write(','.join(fields)+'\n') #csv headers
    with arcpy.da.SearchCursor(fc, fields) as cursor:
        for row in cursor:
            f.write(','.join([str(r) for r in row])+'\n')

This is fine but it requires me to manually use SELECT BY LOCATION and export the dBASE (.dbf) file before I run the script. Is there any script I can write that will allow to SEARCH BY LOCATION then export the selected records into an Excel file all in one go.

I created a SEARCH BY LOCATION script but don't know how i would join them.

import arcpy
arcpy.env.workspace = "Z:\GIS TEST\Select_by_Location"

arcpy.MakeFeatureLayer_management('Bld_Locations.shp', 'Bld_Locations_lyr')
arcpy.SelectLayerByLocation_management('Bld_Locations_lyr', "WITHIN_A_DISTANCE",
                                       'Breakout_Location.shp', "2000 Meters", "NEW_SELECTION")

Anyone have any ideas?

Please remember my Python knowledge is very limited.


texts: Geolocation is not working on my mobile device (USER DENIED GEOLOCATION) - Openlayers 3

texts:
I have the Openlayers 3 Geolocation API working on non-mobile browser correctly, but I get 'User Denied Geolocation' error testing on mobile devices.

What could be the reasons of this error?

If it helps, i'm using chrome in my mobile device.


texts: How to add/remove layer based on Dropdown Selection in openlayers3?

texts:
I am using Openlayers 3 to add list of layers. I want to display only one layer based which is selected in dropdown.

I am defining layers are:

 var layers1 = new ol.layer.Group({
        layers: [
          new ol.layer.Image({

              source: new ol.source.ImageWMS({
                  url: 'http://localhost:8080/geoserver/rdpr/wms',
                  params: {
                      'FORMAT': 'image/png',
                      'VERSION': '1.1.0',
                      'LAYERS': 'rdpr:rdprgeo'
                  },
                  serverType: 'geoserver'
              })

          })
        ]
    });

    var layers2 = new ol.layer.Group({
        layers: [
           new ol.layer.Image({

               source: new ol.source.ImageWMS({
                   url: 'http://localhost:8080/geoserver/rdpr/wms',
                   params: {
                       'FORMAT': 'image/png',
                       'VERSION': '1.1.0',
                       'LAYERS': 'rdpr:sericulturegeo'
                   },
                   serverType: 'geoserver'
               })

           })
        ]
    });

On dropdown change I am calling function to add map:

 $(document).on('change', '#ddlDept', function (e) {
        e.preventDefault();
        dept = $('#ddlDept').val();
        setMapType(dept);
    });

    function setMapType(dept) {
        if (dept == 'RDPR') {
            map.addLayer(layers1);
        } else if (dept == 'Sericulture') {

            map.addLayer(layers2);

        }
    }

Here layer is adding how I can show only one layer at a time.


texts:
I have two coordinates which are projected in EPSG: 3857

coord1 = [-10399758.486973494, 5604341.818491254]
coord2 = [-10402629.416641055, 5593700.936383396]

I'm trying to get them to appear, symbolized by a circle, in a map, like so:

markerLayer = new ol.layer.Vector({
    source: new ol.source.Vector({
        features: [
            new ol.Feature({
                geometry: new ol.geom.Circle(coord1, 50)
            }),
            new ol.Feature({
                geometry: new ol.geom.Circle(coord2, 50)
            })
        ]
    }),
    projection: "EPSG:3857",
    style: function (feature, resolution) {
        return [new ol.style.Style({
            image: new ol.style.Circle({
                radius: 50,
                fill: new ol.style.Fill({
                    color: '#0000FF'
                }),
                stroke: new ol.style.Stroke({
                    color: '#000000'
                })
             })
        })]
    },
    visible: true
});

map.addLayer(markerLayer);

And while I can see that the features are added to the layer, which is added to the map, they don't appear and I can't tell why. Any ideas?


texts: Rendered Map in QGIS from Python Not Projected

texts:
I am trying to render a map using the QGIS editor (eventually will generate hundreds for animation, but just trying to get one working for now). However, the rendered map is not projected (I want it to be: North_America_Albers_Equal_Area_Conic).

The map I want is in the QGIS map canvas following the completion of the code (figure directly below). I saved it using the "save as image" in the drop down menu.

and here is my code...

from PyQt4.QtCore import *
from PyQt4.QtGui import *

#Load project
project = QgsProject.instance()
project.read(QFileInfo('something.qgs'))

#input Layer
lyrPts =  QgsVectorLayer("this.shp", "Qflu", "ogr")

#display layer
reg = QgsMapLayerRegistry.instance()
reg.addMapLayers([lyrPts])

#Filter
lyrPts.setSubsetString('DateIndx = 500')
iface.mapCanvas().refresh()

# create image
img = QImage(QSize(8000, 6000), QImage.Format_ARGB32_Premultiplied)

# set image's background color
color = QColor(255, 255, 255)
img.fill(color.rgb())

# create painter
p = QPainter()
p.begin(img)
p.setRenderHint(QPainter.Antialiasing)

render = QgsMapRenderer()

# set layer set
layers = QgsMapLayerRegistry.instance().mapLayers()
lst = layers.keys()
render.setLayerSet(lst)

# Set destination CRS to match the CRS of the first layer
render.setDestinationCrs(layers.values()[0].crs())

# Enable OTF reprojection
render.setProjectionsEnabled(True)

# set extent
rect = QgsRectangle(xmin=-124, ymin=25, xmax=-69, ymax=52)
rect.scale(1.1)
render.setExtent(rect)

# set output size
render.setOutputSize(img.size(), img.logicalDpiX())

# do the rendering
render.render(p)
p.end()

# save image
img.save("somewhere.png","png")


texts: Distance Measure using QGIS Field Calculator?

texts:
A QGIS newbie who can't for the life of them work out the expression needed to represent distance from a point.

I want to show how a walkable a neighbourhood is. I need do to this by showing what areas are zoned residential and within 500m of parks and transport.

I have a map of a city and I want to show which areas are walkable (i.e close to parks and transport) both Parks and Transport land use has been identified show its just about showing which residential areas are within 500m of a park or transport.

I am following the second half of this tutorial  (http://docs.aurin.org.au/tutorials-and-use-cases/abpl90366-urban-informatics-tutorials/geodesign-density-and-constraints/)

Almost every expression in geometry has given me an error!

Sorry! This what I've tried

CASE WHEN   "MB_CAT11"  ='Residential' >= 400m from  'Transport'  THEN 0 END


texts:
When I use label features with halos in ArcMap, whether using the standard or Maplex labeling engine, the halos in the exported map (PDF) are always shifted vertically, so that instead of the halo being evenly spaced around the text it is flush with the bottom and excessive on the top.

I know others have had this issue: Export Map to PDF Halo Labels shifts Halo to latter width at the end of Label Problem, but the proposed fix doesn't work, because the option to change vertical text alignment is grayed out.  Has anyone else found a way to add halos to maps?


texts: MarkerCluster Animation for OpenLayers2 with Lines

texts:
I would like to implement a MarkerCluster-Animation in OpenLayers2 but could need some advice where to start.
If you have a look at this (OpenLayers2-)webpage:

http://spielplatz-radar.de/#position/M52165100

you can get an idea what I want to do.

If two markers are lying too close to each other and you do a mouseover they will be moved away from their "real" position and a line is drawn to still show where this marker has its "real" position.
So it's more or less something like the MarkerClusterPlugin of Leaflet.

The sourcecode of this webpage is pretty complicated as it uses backbone views so i find it hard to find the important parts and implement this animation in an app that doesn't use backbone.js

Can anybody give me some advices where to start?

Image1: markers spread as they lie too close to each other

Image2: same markers at a higher zoom level: not spread anymore as the icons don't overlap anymore:


texts:
I posted this on the ESRI technical support forum, but I figured I'd cross-post it here, too.  I'm trying to use ArcGIS 10.6 (Desktop Advanced) on a Windows 7 Pro machine.  However, something is obviously missing from my installation.  When I start up ArcMap, I get a pop-up error message saying "Error in LoadPlanXML.  Error number: 5 Description: Value cannot be null.  Parameter name: type."  Otherwise, it appears to start up and work correctly, until I actually try to do anything.  Maps and data display normally.

When I attempt to use any of the tools in ArcToolbox, however, the execution always fails with error code 000210: Cannot create output.  Evidently, this is some type of non-specific error.  I have authorized and installed all extensions, so that's not the issue.  Basically, I can view and select layers and data on the map and in the table of contents, but I can't use any geoprocessing tools at all.  I tried uninstalling and reinstalling, as well as repairing the installation in Add/Remove Programs, with no luck.  It's very strange.

I originally upgraded from 10.1, but to make sure I didn't lose anything important, I found all the system directories with anything in their names related to ArcGIS or ESRI and moved them to a separate archive folder.  I then uninstalled 10.1 and installed 10.6, since you can't directly upgrade from one to the other.  I'm guessing that wasn't how I was supposed to do it, since I'm running into this problem now.


texts: How to parameterize query sent with arcpy.ArcSDESQLExecute class

texts:
I have been developing a geoprocessor which takes user inputs as strings to develop a dynamic sql statment sent to MSSS from an ArcSDESQLExecute class. The app will only allow for controlled input, but should someone gain access to the (secured) gp rest endpoint I need to clean the sql before sending. The ONLY property for this class is an autocommit interval, and the only methods are begin/commit/rollback transaction and execute sql(takes only one string).

Can I hack parameters into my statement with this class, or do I need to pythonically sanitize the input and concatenate it into the sql statement like a barbarian trying to gopher-whack XSS injection? Any other thoughts on keeping the db safe while using dynamic sql through this connection? Stored processes and 3rd party libraries are out.

CONTEXT:
I have a somewhat gnarly, non-spatial, dynamic query that's hitting an MS SQL Server db from a web app. Client is a large institution with fairly stringent networking requirements which force me to make my db connection from the data server, so I'm sending the user inputs to a script which then builds and executes the query on the server, returning a table to the client.

Because the client doesn't have much control over the network, and because the people directly managing this tool don't have any networking chops, we're sticking with a published geoprocessing service to do the lifting here. For this same reason, the libraries which my python has access to are limited to the arcpy and whatever default libraries come with ESRI's python install (numpy, json, time, w/e). I asked specifically about pymssql and mxodbc to the networking guy, who is in the know. His response wasn't a no, but close to it '~how about using arcpy.da cursors or ArcSDEExecute?' To be fair, this is how I learned about ArcSdeExecute. Also, cursors are not a viable option. It makes no sense to have anything other than the db handle these queries, which include nested queries, joins, and pivots. If you know a better library than arcpy that I can count on to do this task, I'm all ears.


texts:
I'm development an android app for navigate inside the university campus, it's my graduation project :).
I did the campus map with Josm, now I have it in .osm

I found many libraries and frameworks for rendering of maps based on OpenStreetMap data but for politics things of the university I can't load the map to publics servers like Open Steet Maps :( (so bad), then, I think make a local map and I found mapsforge as rendering (I don't know for routing) but my osm file doesn't have all information that Mapsforge Map-Writer request for made the Binary Map File for this library.

Now I'm going to try with CartoType but also I have to convert the format type and this apparently it's conflictive

someone did something like this? any recomendation? any way to render a native osm file?


texts: How to convert PCS based point X/Y into GCS Lat/Lon using ArcObjects

texts:
There are so many permutations of questions I've tried to find the answer to my question from various sources, but I have yet to actually find an answer the way that makes sense to me (and works).

I'm using ArcObjects in a ArcMap add-in, and I have shape file loaded with sample data that comes in a Projected Coordinate System.

I want to convert a feature's points (IPoint) which are X/Y coordinates, into it's BASE GCS Lat/Lon values.

For example:

The Data Source in the Shape File shows (Custom since Factory Code shows ZERO):

Projected Coordinate System:    NAD27_BLM_3N_ftUS
Projection: Transverse_Mercator
false_easting:  1640416.67000000
false_northing: 0.00000000
central_meridian:   -165.00000000
scale_factor:   0.99960000
latitude_of_origin: 0.00000000
Linear Unit:    Foot_US

Geographic Coordinate System:   GCS_North_American_1927
Datum:  D_North_American_1927
Prime Meridian:     Greenwich
Angular Unit:   Degree

And I want to convert the X/Y coordinates to be Lat/Lon instead with GCS NAD 27.

There is no transformation, it's the same Datum.

I have tried to use the following code:

IPoint geographicPoint = new Point();
geographicPoint.X = _pcsX;
geographicPoint.Y = _pcsY;
geographicPoint.Z = _z;
geographicPoint.M = _m;
geographicPoint.SpatialReference = _inputSpatialReference; // PCS

ISpatialReference outputSpatialReference = SpatialReference.GenerateSpatialReference(outputCoordinateSystemWKID, false); // GCS

((IGeometry2)geographicPoint).ProjectEx(outputSpatialReference, esriTransformDirection.esriTransformReverse, null, false, 0, 0);

_gcsLat = geographicPoint.Y;
_gcsLong = geographicPoint.X;

I have also tried to use the Project() method as well instead of ProjectEx:

((IGeometry2)geographicPoint).Project(outputSpatialReference);

however, in both cases, I just get the exact same X/Y coordinates in the X/Y values of the geographicPoint, when I am expecting the X/Y values to now be the Long/Lat as I have requested the output coordinate system that is a Geographic Coordinate System.

Source Point:

X: 2440016.02472701
Y: 25980973.0785536

After Projection to 4267:

LAT: 25980973.0785536
LON: 2440016.02472701

Can anyone help?

As Requested: the PRJ file of the input document:
PROJCS["NAD27_BLM_3N_ftUS",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",1640416.67],PARAMETER["false_northing",0],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],UNIT["Foot_US",0.30480060960121924]]


texts: Pulling Spatial Data in Geography Format From MS SQL Server 2008 Using ogr2ogr

texts:
Can the MSSQLSpatial driver support geography fields queried from MS SQL Server 2008 as spatial data?

Background

I have been using unixODBC on an Ubuntu 16.04 machine with ODBC Driver 17 for SQL Server installed. When I enter this command to test my connection:

ogr2ogr -f "GeoJSON" output.json "MSSQL:server=[SERVER_NAME];database=[DB_NAME];tables=dbo.[TABLE](Shape);driver=ODBC Driver 17 for SQL Server;uid=NodeClient;pwd=NodeClient" -overwrite -sql "SELECT TOP 10 ID, Shape.STAsBinary() from dbo.NfhlFloodHazardAreas"

The resulting GeoJSON file contains a normal field called Shape filled with a truncated binary string, and yet the feature's geometry is null.

The following output.json file demonstrates the issue:

{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "": "010300000001000000A1000000B4F99DDAC31A58C020F5AAEC98B03C403C4F588CC31A58..." }, "geometry": null },
{ "type": "Feature", "properties": { "": "01030000000100000078000000080DF4D1EE1E58C090CB64C983B43C408C96E101EF1E58..." }, "geometry": null },

Past Questions

I have read an almost identical issue by another user:

Creating Shape Files from SQL Server using Ogr2ogr

But mine differs from theirs in that my data is stored purely as one datatype, POLYGON, and as a BLOB. I tried applying the top answer's ogr2ogr query, but it resulted in the same problem.

I presume that answer was intended to be used against geometry fields only, but then why does the official documentation for the MSSQLSpatial driver mention support for MS SQL Server's spatial fields, which include both geometry and  geography data?

Is there any way to make the MSSQLSpatial driver recognize the geography data as spatial data, and not an ordinary column on the table?

Full Debug Output

  root@775a08d4796b:/opt/sample# ogr2ogr -f "GeoJSON" output.json
  "MSSQL:server=[SERVER];database=[DATABASE];tables=dbo.[TABLE];driver=ODBC
  Driver 17 for SQL Server;uid=NodeClient;pwd=NodeClient" -overwrite
  -sql "SELECT TOP 10 ID, Shape.STAsBinary() from dbo.[TABLE]" ODBC: SQLDriverConnect(server=[SERVER];database=[DATABASE];driver=ODBC
  Driver 17 for SQL Server;uid=NodeClient;pwd=NodeClient) GDAL:
  GDALOpen(MSSQL:server=[SERVER];database=[DATABASE];tables=dbo.[TABLE];driver=ODBC
  Driver 17 for SQL Server;uid=NodeClient;pwd=NodeClient,
  this=0x13aeac0) succeeds as MSSQLSpatial. GDAL:
  GDALDriver::Create(GeoJSON,output.json,0,0,0,Unknown,(nil))
  MSSQLSpatial: ExecuteSQL(SELECT TOP 10 ID, Shape.STAsBinary() from
  dbo.[TABLE]) called. OGR_MSSQLSpatial: Using column ID as FID for
  table SELECT. Warning 1: The output driver does not natively support
  Binary type for field . Misconversion can happen. -mapFieldType can be
  used to control field type conversion. GDALVectorTranslate: 10
  features written in layer 'SELECT' OGR_MSSQLSpatial: 10 features read
  on layer 'SELECT'. ODBC: SQLDisconnect() GDAL:
  GDALClose(MSSQL:server=[SERVER];database=[DATABASE];tables=dbo.[TABLE];driver=ODBC
  Driver 17 for SQL Server;uid=NodeClient;pwd=NodeClient,
  this=0x13aeac0) GDAL: GDALClose(output.json, this=0x1427970) GDAL: In
  GDALDestroy - unloading GDAL shared library.


texts: How to join attributes of donut polygon to hole polygon in ArcGIS?

texts:
First of all I'm completely new to the realm of GIS and ArcGIS.

Basically I need a reliable way to determine a donut hole's containing donut for a few hundred thousand polygons (where the donut holes are their own polygons in the same feature).

I've come across this question which deals with finding polygons within polygons; however, I need to actually map the internal polygon to its containing polygon (i.e. join the "lake" polygon's attributes to its "island" polygon).

ArcGIS's Spatial Join tool with JOIN_ONE_TO_MANY and COMPLETELY_CONTAINS options looks very promising but doesn't seem to work as expected. I'm guessing this is because the "lake" polygons don't actually overlap the "island" polygons; the holes are cut out of the containing polygons.

Is this possible? I'm using ArcGIS 10.


texts: Creating local copy of an online Potential Flood Inundation Map

texts:
I am completely stuck, usually I can figure out how to create a local copy of hosted services, but this one I can't seem to get anything to work and any suggestions would be great.

Currently I can access the layer using ArcGIS-Pro but can only query by point. I would like to create a local raster layer or .GDB .

Trying to create a local copy for future reference.

Here is the link:
http://www.horrycounty.org/gisweb/rest/services/Public/FloodAreasFlorence/MapServer


texts:
Apologies in advance if this question is incredibly basic, but I've been googling around and I just don't know where to start. I've downloaded some nighttime luminosity data from NASA, and the data comes in TIF format.  I've managed to add the TIF in as a layer in ArcGIS 10, and I've cropped it to be focused just on Africa, but it's a pretty detailed dataset. I think each pixel has an associated value of luminosity, from 0-63.

So, basically I'm trying to get some kind of attribute table out of this that lists each individual pixel and the associated luminosity, along with latitude and longitude of each pixel. I thought the easiest way to go about doing this was to do Raster to Point (so I get a shapefile, something I'm more used to working with), but I tried doing this and received the error that the output was over 2 GB and the process couldn't be finished. Does anyone have any tips?

I also have QGIS if working in that might be easier.


texts: Serving data from large shapefile to mobile app?

texts:
I am writing a native iOS app and need to serve property boundary data as a layer on top of a Google Map. I am an experienced iOS developer, but have little experience in GIS or server-side work (may become obvious as you read on..)!

The raw data is in the form of five shapefiles, each up to three GB in size. I am relaxed about whether these are combined into a single layer or shown separately. I would receive updates to these shapefiles every few months.

I need to display this property boundary layer at high levels of zoom (16+), as i will be working with single properties at a time.

As I understand it, my options (roughly) are:

1:

Build a system that generates the raster or vector tiles on the fly as I request the data for a specific region at a specific zoom level. The nice thing about this is that shapefile updates are easy to handle, as I just need to replace the old shapefiles in my database each time. I understand there would be a bit of a delay serving the tiles but this is not a deal breaker as long as the delay is not too long.

If I am going to use raster tiles I need to receive them using a URL format like this:
http://www.mytileserver.com/tiles/somesortofsecuritykey/layeridentifier/[x]/[y]/[z].png

2:

Use TileMill or similar to create raster tiles for the entire dataset at the levels of zoom I need. This may not be practical as my database would be enormous (I am planning to use AWS S3/EC2 or similar, but still...), but if it did work there would be low latency for my users. This would also be a pain when dealing with updates as I would have to regenerate the entire tile set each time I received updates.

3:

Convert the data to GeoJSON or similar and use the Google Maps functionality to draw polylines to represent the boundary data based on the polygon coordinates. I would only want to do this at the higher zoom levels so I’m not drawing thousands of polylines to the screen.

I understand QGIS or ogr2ogr  will convert a shapefile to GeoJSON. Would a large (3-4 GB) file pose a problem?

If I am going to receive the GeoJSON data I can query it so I only get back the geometry for the portion of the map that is displayed on the screen at any one time?

4:

Some sort of hybrid system of #2 and #3 where I use tiles at say zoom levels of 16-18 and draw polylines based on GeoJSON for zoom 19+.

Given my requirements, can anyone recommend an option to pursue further?

Or is there a totally different approach to consider?


texts:
So I'm trying to get all the fields from an IFeature into a dictionary but the IFeature throws an exception when I try to get the OID.

  Error HRESULT E_FAIL has been returned from a call to a COM component.

This only happens if I'm using a gdb file, shapefiles work fine. What am I doing wrong?

    public static Dictionary<string, object> ReadFeature(IFeature currentFeature)
    {
        var id = currentFeature.OID;//Exception thrown here
        var featureRow = currentFeature.Table.GetRow(id);
        var fields = featureRow.Fields;

        //Add all the fields and their values to the features list
        var fieldsList = new Dictionary<string, object>();
        for (var i = 0; i < fields.FieldCount; i++)
        {
            fieldsList.Add(fields.Field[i].Name, featureRow.Value[i]);
        }

        return fieldsList;
    }

The IFeature object looks like this at the time of the exception:

UPDATE:
The HasOID property is false on the gdb but on the shapefile it's true. On the shapefile the object id is in the column FID and in the gdb it's OBJECTID. Both are read only and are of type Object ID. Why do they behave differently?


texts:
I have two shapefiles. One contains a raster with grid cells and the other administrative boundaries.
I would like to union the polygons from both layers but geoprocessing - union yields the following error:

Processing algorithm…
AlgorithmDialog
Input parameters:
{ 'INPUT' : '/ne_10m_admin_1_states_provinces/ne_10m_admin_1_states_provinces.shp', 'OVERLAY' : 'split.shp', 'OUTPUT' : 'memory:' }

Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\processing\algs\qgis\Union.py", line 94, in processAlgorithm indexA = QgsSpatialIndex(sourceA, feedback) Exception: unknown

Execution failed after 0.19 seconds

Loading resulting layers
Algorithm 'Union' finished


texts:
I'm using Mapfish Print v3 to print a layer from the following link:

http://webapps.sit.puglia.it/arcgis/services/Background/TNOInquadramento/MapServer/WMSServer

To test the printing function I'm using the Test Print page shipped with the 3.3 shapshot.
Unfortunately any single attempt I've done so far has been unsuccessful: the pdf file produced always renders a blank map.

Still I can load all the layers into ArcGIS.
So I guess the problem must be on my Mapfish configuration/JSON request.

I tested my config.yaml and JSON request against the following link:

http://webapps.sit.puglia.it/arcgis/services/BaseMaps/Ortofoto2013/ImageServer/WMSServer

and it worked fine (although no matter the layers' names in the JSON request, I always got the correct result, anyway...).

This is my config.yaml:

templates:
  #===========================================================================
  A4 landscape: !template
  #===========================================================================
    reportTemplate: simpleReport.jrxml
    attributes:
      map: !map
        maxDpi: 400
        width: 780
        height: 330
    processors:
    - !reportBuilder # compile all reports in current directory
      directory: '.'
    - !createMap
      inputMapper: {map: map}
      outputMapper: {mapSubReport: map}
    - !configureHttpRequests
          httpProcessors:
          - !restrictUris
            matchers:
            - !ipMatch
              ip: webapps.sit.puglia.it

I've made sure to allow the use of the server.

This is my JSON request:

{
    "attributes": {"map": {
        "bbox": [
            2251632.4276,
            4054757.3924,
            2835795.3321,
            5221314.5428
        ],
        "dpi": 72,
        "layers": [{
            "baseURL": "http://webapps.sit.puglia.it/arcgis/services/Background/TNOInquadramento/MapServer/WMSServer",
            "customParams": {
                "EXCEPTIONS": "INIMAGE",
                "TRANSPARENT": "true"
            },
            "imageFormat": "image/png",
            "layers": ["Confini Provinciali"],
            "type": "WMS",
            "version": "1.3.0"
        }],
        "projection": "EPSG:3004",
        "rotation": 0
    }},
    "layout": "A4 landscape"
}

Actually using the layer's name I get the following error:

  Parameter 'layers' contains unacceptable layer names.

which I solved using the layer id.

So what's wrong with the first service? Is it some peculiarity of the service or is it my own Mapfish instance?


texts: Different distance when using "Measure Line" tool and manually with scale in QGIS 3

texts:
Using QGIS's "Measure Line" tool I get a distance of 1.22km between two points.

But if I use the scale indicated at the bottom of the screen, 1:50000, and measure with a ruler, the distance is 2.5km (as if the scale were 1:25000). The project is in UTM.

The same thing happens in Print Composer: the scale bar is 1:25000 compatible, although the scale is set to 1:50000.

What is happening?


texts: Using OpenStreetMap data in QGIS, but street names repeat too much

texts: I have downloaded some roads in a section of Los Angeles from OpenStreetMap. I used overpassturbo.eu to generate the data, using the expression highway=primary. However, because these streets are broken into many segments (bridges, changes in speed limits, etc.), the street names repeat too much. Is there a way in QGIS, or elsewhere, to edit this data to remove some of these repeating street names? I have been looking for something in QGIS, but so far no luck.


texts:
I'm trying to complete a QGIS tutorial from the documentation, but I am not seeing any attributes fields for the districts in Western_Cape_UTM33S.shp:

http://docs.qgis.org/2.18/en/docs/training_manual/complete_analysis/analysis_exercise.html#find-the-correct-districts

The data are here:

https://www.dropbox.com/s/q5evvkizuunrcs0/more_analysis.zip?dl=0

I tried the using the answer as suggested in this question, but didn't have any luck:

QGIS Attribute Table Not Displaying Data

I haven't had this issue with other shapefiles thus far.

I'm not sure if this is an issue with my QGIS setup or with the file itself


texts: Installing ArcGIS Desktop on Chromebook?

texts:
I teach a course on ArcGIS Desktop, and both of the last two times I taught the course I had a student whose computer was a Chromebook.

I normally tell Mac and Linux users to install virtual machine software (VMWare or Oracle Virtualbox), and then install Windows onto a virtual machine in order to have an environment onto which to install ArcGIS Desktop with a student license.

What options (if any) exist for Chromebook users?


texts: Copy and Paste a row with many attributes into new features in ArcMap

texts:
I have a feature class I just added a few features and I would like to copy and paste the whole row from existing feature to the new features.
As I have many attributes and features, using copy and paste is very time consuming and using join and field calculator is also very time consuming as I have too many attributes.
Is there a way to copy whole row and paste to another row. Or should I try SearchCursor. I am not very familiar with Python but I will to try if SearchCursor can do the work.
I am using ArcMap 10.4.


texts:
I'm new in Mapbox Studio. My language is Persian. I published new map at here. When I use local language for label locations, it show as follow:

How Can I Fix rtl text labeling in Mapbox Studio?


texts:
I have a data table about national bus lines, with timestamps, vehicle IDs, line IDs (which line the bus is moving on), and coordinates(geom). I can add my points to QGIS on show them on OSM, but I'd like to create lines from these points (so I can show fuel lvl on them, for example or speed).

Tried using plugins inside QGIS for this, but did not properly worked.

I am quite new to SQL (just started using it, for like a few weeks), so how can I make lines from my coordinates, grouping by line IDs and vehichle IDs?

Found something about ST_Makeline, but with my very basic knowledge, I am struggling getting a grip on it.


texts: Seeking spatial data for very specific administrative boundaries in Ontario

texts:
I was wondering if anyone might know where I can download the rectangular administrative boundaries shown in the image below.  I have highlighted one of them in red.  On the image, you can see that the naming convention consists of some sort of numeric administrative identifier, as well as a name for each area (which seems to correlate roughly to the nearest city or town of any significance).

I require the spatial file in order to provide a quote for a large project and I haven't been able to find anything.  The only information the client has is in paper format.  The title on the overview map shown below is Provincial Series and Crown Land Use Atlas Index - 1:100,000.  I have searched the Provincial data available from LIO, the Federal data available at GeoGratis, and I've tried numerous Google searches with no luck.

I'd like to avoid digitizing if possible.  Here's the image:


texts: Reading data to geopandas using WFS - GML format

texts:
This relates to the question here:
Reading data to geopandas using WFS?

Is there a way to to do the same with a service that does not supply the data in GeoJSON format, but in GML-format?

The webservice is:
https://arealinformation.miljoeportal.dk/gis/services/DAIdb/MapServer/WFSServer

And I want to read a single layer.


texts: Is there any way to use Cesiumjs to import 3D Models using the British National Grid (OSGB36)?

texts:
I am trying to import a 3D model (.gltf) into Cesium which is in OSGB36 projection, however I know that Cesiumjs doesn't support British projection natively.

I've tried changing the origin of the map and reporject the lat and lon based on the x,y,z coordinates cesium's api gives you using entity.position.getValue().

var entity = viewer.entities.add({
    // Lon, Lat, Height, Elipsode
    position : Cesium.Cartesian3.fromDegrees(-10.6658787,50.6943631),
    model : {
        uri : '../../static/structures/models/duck/duck.gltf'
    }
});

I am looking for which would be the best and quickest way to include this 3d Models, because also would like to use OL3-Cesium to integrate Cesiumjs and Openlayers 3 which only support  EPSG:4326 and EPSG:3857 projections and not British.


texts: How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

texts:
My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues.

I'm installing packages from the Ubuntu GIS PPA.

Before, I would install the python-gdal Ubuntu package to install GDAL with a copy of the osgeo python library. I would also install postgresql-9.1-postgis.  Now, installing postgresql-9.3-postgis-2.1 uninstalls python-gdal, and vice versa. They are incompatible with one another, since one requires libgdal1 and the other requires libgdal1h. I have found instructions to compile libgdal from source, specifying to include the osgeo python library, but I would prefer to use a package if possible.

Does anyone know of a way to have PostGIS 2.1 and the Python osgeo library installed together without having to compile from source?


texts: Create QGIS Plugin UI with QGIS Designer - style like original tools

texts:
I developed a QGIS Plugin with QGIS Designer but my UI does not look as nice as original QGIS Tools and I was wondering if its possible to make them as good looking.

Specifically, I don't manage to create a nice explanation box like the ones of the original QGIS tools. In the following example, the titel has a higher font and the whole box can be dynamically made smaller or bigger. Any ideas on how this can be done or perhabs a useful link I missed?


texts: GDAL FileGDB Driver with Anaconda / ArcGIS Pro

texts:
I have installed GDAL using the ArcGIS Pro (2.1.2) Package Manager. This has installed GDAL 2.2.2, which runs fine, except that it didn't install the FileGDB driver which is what I need it for. It is not in the ogr driver list, there is no gdal-plugins folder on my computer and no FileGDB.dll as well. Whenever I open the Python command prompt I get the following error:

The system cannot find the specified path.

(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\etc\conda\activate.d>set "GDAL_DRIVER_PATH="

(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>

Whatever path I specify in the gdal-activate.bat file, it keeps throwing that same error. I have also tried adding GDAL_DRIVER_PATH manually to my environment variables, but keep getting the same error. I have tried this with a clean install of ArcGIS Pro, installing only gdal, and it throws the same error.

How do I get GDAL to find my FileGDB.dll file?


texts: Selecting features with same geometry in same shapefile

texts:
I am working on a public transport network in one shapefile (polyline type) in QGIS 2.18.

Certain bus routes share the same paths, means that one line-part can repeat more than once. It always has the same identical geometry.

For instance, if I select a feature with 'Identify Features' I will have three outcomes in the Identify results table, see an image below.

I want to select all the features that share the same geometry and further process it. I intend to sign an attribute that says if the layer overlaps.

Can you suggest the most beneficial way?

So far I have in mind:

Vector > Research Tools > Select by location. However, I am not that certain regarding the geometric predicate. Because the 'equals' either 'overlaps' do not give me any sufficient outcome.
Vector > Geometry Tools > Geometry checker, do not know what to choose in conditions and properties.
Plugins > Geometry Validator > Validate geometries, does not provide any errors notifications.


texts: Calculating Density of Raster cells in ArcGIS Desktop?

texts:
Is there a way to calculate the density of a raster cells in ArcGIS?

The dataset I have is of ground points (there are some cells assigned no-value) and I want to calculate the density of points so that I can chose the best interpolation method.


texts: Google Earth Enterprise vs. ArcGIS Server

texts: All - looks like it's been a while (May '11) since the GEE vs. ArcGIS server has been updated. Would anyone have more current feedback on this?  Is the price for GEE still hovering around $620K USD?  Thanks - Gail


texts:
I downloaded GTOPO30 *.DEM files, and extracted a contour line at 2000m altitude using gdal_contour. In the resulting shapefile, I have many small polygons in areas where the altitude is close to that contour line, and the image looks quite noisy.

How can I, preferably using gdal/ogr or QGis, somehow 'downsample' these contours, so that the picture looks cleaner? I basically want to eliminate all small features.

PS: One way would be to downsample the grid before doing the contour extraction; is this the way to go, or should i rather downsample the shapefile?


texts: Converting TIFF file to LAS file in QGIS?

texts:
I've been asked by a client to compile LiDAR files (currently in GeoTiff format) into a LAS dataset.

Is this possible within QGIS?

I have downloaded LAStools, but I'm still fairly new to LiDAR so I'm not sure what all the tools do!

I know this is possible in ArcGIS, but I don't currently have access to the software. I see a lot of questions already asked concerning opening LAS files in QGIS, but here I am wanting to convert TIFFs into LAS format.

I don't have the raw data - I only have asc files from which I've made the GeoTiffs from.


texts: How to replace protocol in geoext.form.formpanel

texts:
I've been scratching my head over this and I'm wondering if this is possible. I want to replace the protocol of the GeoExt.form.FormPanel in the following way:

to render the formpanel, I defined a variable "proto" as null outside the formpanel (var proto = null).
then "proto" goes inside the formpanel (protocol: proto).
in the handler function of the button a new variable "proto" is defined. I want to replace this new variable inside the formpanel.

Since extjs, geoext, openlayers are javascript libraries, I've tried things such as "eval" to make the variable "proto" inside the handler accessible in the formpanel but no luck so far. Here it is a simplified example to show this:

var proto = null;

var formPanel = new GeoExt.form.FormPanel({
    protocol: proto,                # <--- replace with [1]
    items: [{
        xtype: "combo",
        id: "idcombo",
        etc...
    }, {
        xtype: "textfield",
        id: "idtext",
        etc...
    }],
    button:[{
        text: "search",
        handler: function() {
            formPanel.search();
            var combo = Ext.getCmp('idcombo').getValue();      # <--- this works and gets the value chosen in "xtype: combo"
            var proto: new OpenLayers.Protocol.HTTP({          # <--- [1] (ie. new variable "proto")
                url: "http://www.pub.pub/" + combo + "/somestuff/",    # <--- this works
                format: etc...
            })
        }
    }]
})

how could I do this? I'll appreciate your support, thanks in advance.

Best regards,

Gery


texts:
I'm trying to import a .shp into postgre using ogr2ogr but i'm stuck with an error with the select clause, any ideas?

##vsmap_path=vector
##millesime=number 2015

from qgis.core import *
import os

param = {'host':'x.xxx.xx.xx','dbname':'xxxxx' ,'port':'xxxx','user':'xxxxx','password':'xxxxxx'}

ogrPath = "/".join(QgsApplication.prefixPath().split("/")[:-2])+"/bin/"#Definie le chemin de OGR

vsmapLayer=processing.getObject(vsmap_path)#Transforme la couche en objet
vsmapName = vsmapLayer.name()+'_'+str(millesime) #Change le nom de le couche

commande="""ogr2ogr -f "PostgreSQL" -a_srs "EPSG:2154" PG:"host='{host}' dbname='{dbname}' port='{port}' user='{user}' password='{password}'" -lco SCHEMA="0-reseau" -lco OVERWRITE=YES  -lco FID=pkey -sql "SELECT lib_rte FROM {vsmap} WHERE gestionnaire='DIRNO'" '{vsmap_path}' --config OGR_TRUNCATE=YES PG_USE_COPY=YES""".format(vsmap=vsmapName,vsmap_path=vsmap_path,**param)

new_commande = "echo import en cours... & "+ogrPath+commande
os.system(new_commande)


texts: Generating a table of distances between points and edges of nearest polygons?

texts:
I have two shapefiles, one of made up of country borders and one made up of points randomly dotted around an ocean.  How do I generate a table of all the distances between the points and the closest edge of a polygon?

So for each point I will have a distance to it's nearest polygon/country.

I've looked at generating a near table but found that I only got distances to one plate (for all the points).

Let me know if you need any more information.


texts:
I browsed regarding this question and I couldn't find any better solution. This link has some information for OpenLayers but not for Leaflet.

How do I access a secured WMS via Leaflet in with JavaScript? Do I need to pass user name and password as parameter? Does Leaflet support access to secured WMS server?


texts: `MapnikRasterizer` is giving an error (bad allocation) in FME

texts:
What could be the issue here. MapnikRasterizer is giving an error!

 MapnikRasterizer(MapnikFactory): Performing rasterization...

 MapnikRasterizer(MapnikFactory): Failed to rasterize data. The error was: bad allocation

 MapnikRasterizer(MapnikFactory): A fatal error has occurred. Check the logfile above for details

Here is the FME file

A snapshot:

As stated here in this article, there is a bug with MapnikRasterizer. this transformer unlike ImageRasterizer gives the option to change color of line, text, polygon etc. If using MapnikRasterizer is not possible how can I customize the color of the lines and the text before ImageRasterizering.


texts: Is it possible to determine Collection Date of ESRI World Imagery Basemap

texts:
It seems like it was possible to do this with Google Imagery if I recall but is there any way to determine the date of collection of Esri's World Imagery basemap (or other basemaps) at a given location?

Something I read indicated that this was updated Sept, 2014 but I don't think that has anything to do with the date of collection.

I have been telling people that it is 2014 Imagery but I've been challenged on that statement because features on the landscape are showing up that have reportedly been removed.

The basemap I'm most interested in knowing about is World_Imagery (MapServer).


texts: Modify feature: moving or change the shape

texts:
When the user makes some edit on features on ArcMap, the user can make some changes like moving the feature, editing the attributes or changing the shape.

How could I know if the user moved the feature or changed the shape?

I want to put different conditions on the editing according to what the user did.


texts: Directly edit features in non-SDE Oracle feature class?

texts:
In ArcMap, is it possible to directly open an edit session on a feature class in an Oracle database connection if that Oracle database is not managed in SDE?

It is of course easy to edit the features in a local file geodatabase copy, but I want to perform edits directly on features in a table in Oracle that will not be managed in SDE, if possible.

Currently, I receive "Warning: The workspace containing this data cannot be edited" when attempting to open the edit session.


texts: Importing WMS from GeoServer to ArcGIS Online

texts:
Can anybody give me step-by-step info for adding WMS from GeoServer to ArcGIS Online?
I tried many times but failed. I am able to add the same link on ArcMap but not in AGOL.


texts: Use of satellite-based augmentation outside of base station coverage

texts:
In certain locations GPS units can recieve an SBAS correction signal (WAAS, EGNOS etc) but are outside the coverage area of a base station.  For example, EGNOS signals can theoretically be recieved in Africa but lack local base stations that can provide correction data.

In such areas should SBAS be turned off?
In the event that SBAS is turned on what kind of error is likely to be introduced as a result of incorrect correction?

I am specifically interested in consumer GPS units (such as Garmin).


texts: Earth Engine error with global variables - using to calculate matrix error

texts:
After sorting my image using training data,

//***********************************************************************
//                    SEPARATE TEST AND TRAIN SAMPLES
//***********************************************************************
// delimitate samples to test and train

var trainSize = dataset.size().multiply(0.7).int()
var testSize = dataset.size().multiply(0.3).int()

var dataTrain = dadosRandomizados
  .sort("randomPreClassificacao")
  .toList(trainSize, 1)

var dataTest = dadosRandomizados
  .sort("randomPreClassificacao")
  .toList(testSize, trainSize)

//***********************************************************************
//       CREATE CLASSIFIER - create an choosen classifier - ten trees
//***********************************************************************
var classificador = ee.Classifier.randomForest(10)

//***********************************************************************
//                    TRAIN CLASSIFIER
//***********************************************************************

//train the classifier
var classificadorTreinado = classificador.train({
  features: dataTrain,
  classProperty: 'CLASS',
  inputProperties: bands
})

var imagemClassificada = addndvi_2018.select(bands).classify(classificadorTreinado)

I want to use my test data to calculate the error matrix, the accuracy of the consumer and the producer.

var testClassificador = testSize.classify(classificadorTreinado)
var errorMatrix = testClassificado.errorMatrix('CLASS', 'classification')
print('errorMatrix:', errorMatrix)
print('accuracy:',  errorMatrix.accuracy())
print('consumersAccuracy:', errorMatrix.consumersAccuracy())
print('producersAccuracy:', errorMatrix.producersAccuracy())

However, I am having a global variable declaration error, whereas for Earth Engine there are reserved objects.

  testSize.classify is not a function

Here is my code in Earth Engine


texts:
I'm having trouble generating a TIN. Repeatedly, I obtain:

ERROR 050035: no features were added to the TIN.

I can't figure out what I'm doing incorrectly. There is only one feature, namely "DEM_points". Those points all have an Object_ID, a point shape, and an elevation number (a short) associated with them. There are 2864 of such points contained within the feature class.
Here are some screenshots of what I tried:


texts: How to determine uncovered fixed units using RadioMobile

texts:
I've been tasked with determining if certain houses in a specific area won't be covered by a proposed radio network. The houses and stations are fixed but I'm using RadioMobile which doesn't seem to have a batch RadioLink feature (gets the direct line connection with the final signal strength at the end point). My current solution is to generate a bunch of very high resolution coverage maps and then import the sig/txt coverage into QGIS but to get the right resolution takes a huge amount of time to process.

The batch options in RadioMobile are for cartesian maps only but I only need the signal strength at +-500 unique coordinates/points which means it would be cumbersome to do it manually, one by one.

Are there any faster yet still reasonably accurate ways of accomplishing this?


texts: interpreting the negative and positive values of profile curvature map in GIS

texts:
I would like to have help in interpreting the values returned by ArcGIS for profile curvature.
By reading this Esri's webpage (http://blogs.esri.com/esri/arcgis/2010/10/27/understanding-curvature-rasters/), it seems that negative values should correspond to profiles upwardly convex (fig. 16.20A).

Now, it seems counter intuitive to me, since I would imagine that negative values would best convey a sense of "concavity".

I was just wondering if that reference is correct or if some error (typo?) would account for that seemingly oddity.


texts:
I tried to install pythonwin26-212 from ArcGIS10.0 Desktop CD. pythonwin26-212 stops working as soon as I press "Enter" in the interactive window. (ps. I downloaded pythonwin26-212 from sourceforge too. It crashes the same way.) So, I downloaded pythonwin26-218 from sourceforge, and installed it. The pythonwin26-218 wouldn't crash but it couldn't recognize arcpy. I doubt the reason would be the unmatched directories. pythonwin is supposed to be in the same folder as numpy (?) if it was installed from the CD, but it is now in a different folder:

C:\Python26\ArcGIS10.0\Lib\site-packages\numpy

C:\Python26\Lib\site-packages\pythonwin

After I move the pythonwin folder into C:\Python26\ArcGIS10.0\Lib\site-packages\

I click the pythonwin .exe file, it wouldn't open but gives the following message:

Traceback (most recent call last):
  File "", line 1, in
  File "pywin\framework\startup.py", line 49, in
    import(moduleName)
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\intpyapp.py", line 3, in
    import win32con
ImportError: No module named win32con

Anyone knows how to fix this? Thanks!
Thanks,
A.


texts: GDAL Warp giving garbage data on edges when transforming to WGS 84

texts:
I want to change one tiff file to USGS DEM file. For that I am doing following steps:

Transform the tiff file to WGS84 coordiantes using Gdal Wrap utility

gdalwarp -t_srs EPSG:4326 -dstnodata -90909 -of GTiff Source.tif DestWGS84.tif
Then convert the WgS84 tiff file to DEM file using Gdal Translate utility

gdalTranslate -of USGSDEM DestWGS84.tif Final.dem

When I pass -dstnodata swirch in gdalwarp uitlity the created DEM file have invalid data at the edges.

But when I don't pass the no data switch then the minimum elevation is not set (shows zero) and hence other computaion fails.

Can we create DEM file without transforming it in WGS84??


texts: Why do most area calculations result in 0?

texts:
I would like to autocalculate area (acres) for a shapefile that is in UTM zone 16 CRS.

I have tried the "Vector|Geometry Tools|Add/export geometry columns" and also the field calculator.  The first gives me a warning saying

currently QGIS doesn't allow simultaneous access from threads to the same data source.
Make sure your layer's tables are closed. Continue?

When I click YES, it creates two new columns   AREA  &  PERIMETER.

The AREA column is mostly 0's with a few values such as 2e-06 and so on.
The PERIMETER column gives mostly values along the lines of .003526 and so on.

Questions:

What is the warning it is giving me and why are the values so
sporadic?
Also when I use the field calculator tool, it seems to give
me values close to what the field area should be but when I click
SAVE EDITS all the values turn to 0's. What am I doing wrong?


texts:
I have downloaded some files from census website and did some cleaning to get ZCTA map for new york, but I noticed that there are overlapped regions (some regions are inside others). For some statistical purposes, It needs to be isolated. I looked online for some answers but I couldn't find a convenient answer to this.

I ended up producing file similar to this one:
http://catalog.opendata.city/dataset/nyc-zip-code-tabulation-areas/resource/eec14f19-9794-46ef-9bf4-7f6835ffbf4c

If search "Manhattan"; you will see these small squares inside big ones.

Can anyone who has experience with GIS explain why ? Is it problem related to drawing polygons or it's really overlapped.


texts: ogr2ogr sql - how to call file from a variable set in a loop in windows batch

texts:
I have a command

ogr2ogr -f sqlite -dsco SPATIALITE=YES " !outfile!.sqlite !infile1! -nln !outfile! -dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.name, B.name FROM !infile2! A, !infile3! B WHERE ST_Intersects(A.geometry, B.geometry)"

where infile2 and infile3 are set as the SQLite input table name variables which change with each iteration of the loop.

I am using this in ogr2ogr at command line as part of a windows batch file. From previous investigation I find that the prior loop that sets variables infile and outfile works fine with ogr2ogr outside of the sql statement (hence not displayed here). However I am having trouble finding the syntax for within the sql statement, in order to call the table name variables from the loop each time it iterates. I have experimented with "", '', %%, $ and all manner of combinations.

After afalciano's answer i found that simply inserting !infile!.!infile2! etc didn't work so I have amended my code as follows (this time including a revised loop. This still does not work.

for %%i in (*inputfile.sqlite) do (

SET "infile=%%i"
SET "infile1=!infile:inputfile.sqlite=inputtable!"
SET "infile2=!infile1:inputtable=inputfile.sqlite.!infile1!!"
SET "infile3=!infile2:inputfile.sqlite.!infile1!=inputfile.sqlite.!infile1!2!"
SET "outfile=!infile3:inputfile.sqlite.!infile1!2=outputtable!"

ogr2ogr -f sqlite -dsco SPATIALITE=YES " !outfile!.sqlite !infile! -nln !outfile! -dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.name, B.name FROM !infile2! A, !infile3! B WHERE ST_Intersects(A.geometry, B.geometry)"
)


texts:
I have tried to create a circle of desired range using following code but not working. Please guide me.

function createBuffer(lat, lon, range) {

var style = new ol.style.Style({
    fill : new ol.style.Fill({
    color : 'yellow',
    opacity : 0.6,
    color : 'rgba(255,255,204,0.3)'
}),
stroke : new ol.style.Stroke({
    width : 2,
    // color: 'rgba(255, 100, 50, 0.8)'
    color : 'red',
    radius : 1
}),
image : new ol.style.Circle({
    fill : new ol.style.Fill({
    // color: 'rgba(55, 200, 150, 0.5)'
    color : 'rgba(51, 204, 255,0.3)'
}),
stroke : new ol.style.Stroke({
    width : 1,
    color : 'blue'
    // color:'rgb(230, 184, 0,0)'
}),
radius : 3
}),
  });
var  features = [];
var point = new ol.geom.Circle(ol.proj.transform([parseFloat(lat),parseFloat(lon)], 'EPSG:4326', 'EPSG:4326'),range*1210);
console.log(point.getCenter());
console.log(point);

// Features
var pointFeature = new ol.Feature(point);
features.push(pointFeature);

// Source and vector layer
var vectorSource = new ol.source.Vector({
    projection: 'EPSG:4326',
    features: features
});

var vectorLayer = new ol.layer.Vector({
    source : vectorSource,
    style : style
});
map.renderSync();
map.addLayer(vectorLayer);
}


texts: Selecting leaflet markers based on Json features

texts:
I have data coming from a Json file and I created a layer based on this Json file using markerClusterGroup. I am hitting the wall trying to do two things:

1 - Select some markers based on some Json's feature ("temperatura", "salinidade","corrente", "profundidade" e "geofisico") in xbt.json and using a select list in the HTML:

<select name="sometext" >
  <option value="temperatura">temperatura</option>
  <option value="salinidade">salinidade</option>
  <option value="corrente">corrente</option>
  <option value="profundidade">profundidade</option>
  <option value="geofisico">geofisico</option>
</select>

2 - Change the marker icon using the function and code below;

var greenIcon = L.icon({
    iconUrl: 'icon/leaf-green.png',
    shadowUrl: 'icon/leaf-shadow.png',

    iconSize:     [38, 95], // size of the icon
    shadowSize:   [50, 64], // size of the shadow
    iconAnchor:   [22, 94], // point of the icon which will correspond to marker's location
    shadowAnchor: [4, 62],  // the same for the shadow
    popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor
});

That is how I am adding the json to the map using popups and makercluster:

var xbt = getJson('geojson/xbt.json');
var markers_xbt = L.markerClusterGroup();
var estacoes_xbt = L.geoJson(xbt, {
        onEachFeature: function (feature, layer) //functionality on click on feature
            {
            layer.bindPopup("Navio: "+feature.properties.navio+"
"+"Comissao: "+feature.properties.comissao+"
"+ "Bandeira do Navio:"+feature.properties.naviobandeira+"
"+"Equipamento: "+feature.properties.equipamento+"
"+ "Inicio da Comissao:"+feature.properties.iniciocomissao+"
"+"Fim da Comissao : "+feature.properties.fimcomissao+"
"+"Data de Lancamento: "+ feature.properties.estacaodata+"
"+"Hora de Lancamento: " +feature.properties.estacaohora+"
"+"Quadrado de Marsden: "+feature.properties.quadrado+"
"+"Subquadrado de Marsden: "+feature.properties.subquadrado ); //just to show something in the popup. could be part of the geojson as well!
            }

        });
    markers_xbt.addLayer(estacoes_xbt); // add it to the cluster group
    map.addLayer(markers_xbt);      // add it to the map
    map.fitBounds(markers_xbt.getBounds()); //set view on the cluster extend


texts:
I have recently downloaded ASTER data from the glovis.usgs.gov website. The data was downloaded in a .HDF format and I have been unable to open these files in Arcmap, i'm using ArcGIS 10.4. When trying to add the file to ArcMap I receive a warning stating "Invalid raster dataset. Failed to create raster layer".

Can someone help me remedy this problem or point me in another direction to get free ASTER imagery?


texts: I'm using Time Manager and QGIS 1.8.0 and I am stuck at date-format conversion. Time Manager needs Gregorian format YYYY-MM-DD HH:MM:SS.ssssss in text field and I have thousands of records in "month/day/year hour:minute:second" format (Julian format). As I'm not a GIS expert I need some directions to make this conversion correctly and be happy with Time Manager presentations.


texts: re-project from EPSG:4326 to polar projection

texts:
I have global georeferenced DEM tiff file in EPSG:4326 and want to re-project in EPSG:3411. I used this command:

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3411 global.tif polar.tif

which resulted in:

What am I missing here, and how can I reproject to polar projection and actually get content reprojected instead this black hole?

gdalinfo output:

Driver: GTiff/GeoTIFF
Files: global.tif
Size is 2160, 1080
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 = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.166666666666667,-0.166666666666667)
Metadata:
  AREA_OR_POINT=Area
  NC_GLOBAL#Conventions=COARDS/CF-1.0
  NC_GLOBAL#GMT_version=4.4.0
  NC_GLOBAL#history=grdsample -V ETOPO1_Ice_g_gmt4.grd -GETOPO1_Ice_c_gmt4.grd=ni -T
  NC_GLOBAL#node_offset=1
  NC_GLOBAL#title=ETOPO1_Ice_c_gmt4.grd
  x#actual_range=-180, 180
  x#long_name=Longitude
  x#units=degrees
  y#actual_range=-90, 90
  y#long_name=Latitude
  y#units=degrees
  z#_FillValue=-2147483648
  z#actual_range=-10803, 8333
  z#long_name=z
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
Lower Left  (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)
Band 1 Block=2160x1 Type=Int16, ColorInterp=Gray
  NoData Value=-2147483648
  Metadata:
    NETCDF_VARNAME=z

I resized original with gdal_translate and did georeference


texts: How to draw a polygon around the point with condition in ArcMap?

texts:
I have above 2000 points where each point has a field which indicates a number of incidents from 0 to 300.
I want to draw a polygon around each of these points where the total number of incidents should be 1000 (with small deviance).

One polygon should cover more than 4 points in order to achieve a minimum sum of 1000.

The distance of the points should be minimal therefore we will have multiple neighboring polygons which has same/similar number of incidents covering multiple points.

Its logically simple and can be done manually but I couldn't find out how to do it automatically.


texts: Expression grouping polygons, ordering and assigning ordern-no in QGIS

texts:
To solve a problem (details see here) I am looking for an expression in QGIS (3.16) that creates a new field and should achieve this:

On a polygon-layer, it should group together all polygons that have the same attribute-value
For each group, it should order the containing features according to some value, let's say for demonstration puropose the area ($area)
It should assign kind of an auto-increment value to the features of each group (smallest gets 1).

The Result would look something like this:

I tried different combinations of aggregate and arrays, however I'm not sure where to start and how to combine: how do I create an expression that creates such a new value?


texts: min/max scale doesn't work in Openlayers

texts:
I need to create a map service where the map scale should be between 1:5000 to 1:50000. My code is as follows:

var options = {
                    controls: [],
                    scales: [5000, 50000],
                    maxScale: 1/5000,
                    minScale: 1/50000,
                    projection: new OpenLayers.Projection("EPSG:3857"),
                    displayProjection: new OpenLayers.Projection("EPSG:4326"),
                    maxExtent: bounds,
                    units: 'm'
                 };

         var map, vectors, controls;
         function init(){

         map = new OpenLayers.Map('map',options);
         var gphy = new OpenLayers.Layer.Google(
                "Google Physical",
                {type: google.maps.MapTypeId.TERRAIN,minZoomLevel: 6}
                );

          var gmap = new OpenLayers.Layer.Google(
                    "Google Streets",
                {maxZoomLevels: 20,minZoomLevel: 6}
                );
          var ghyb = new OpenLayers.Layer.Google(
                    "Google Hybrid",
                    {type: google.maps.MapTypeId.HYBRID,maxZoomLevels: 20,minZoomLevel: 6}
                );
          var gsat = new OpenLayers.Layer.Google(
                    "Google Satellite",
                    {type: google.maps.MapTypeId.SATELLITE,maxZoomLevels: 22,minZoomLevel: 6}
                );

          var vaga_wms = new OpenLayers.Layer.WMS( "Road",
                    "http://localhost:8090/geoserver/wms/wsNYCRoad", {
                    layers: 'vagar_alla_p',
                    styles: '',
                    transparent:true,
                    tiled: 'false'
                },
                {
                    buffer: 0,
                    displayOutsideMaxExtent: true,
                    isBaseLayer: false
                });

However, the zoom in/out button disappeared (upper left corner) and the map can not be zoomed at all.

If I change the code to

var map = new OpenLayers.Map(
            {
            div: "map",
            allOverlays: true
                 });

Then I do got zoom in/out button but the map can be e.g. zoomed in more than 1:5000.

How can I solve this problem?


texts:
I am working with Landsat 7 ETM+ SRC-off imagery. I'm doing some land-cover classification for a place in Kenya. My problem is the no-data stripes in the image.

Is there a way in which I can interpolate data for such 'empty' areas using the neighbouring pixels?


texts:
I am looking for export QGIS Style in MapNik (so, his .xml format)
I see that Quantumnik plugin can do that, but is not supported anymore (and cannot be installed at all) .

Is there any alternative than installing QGIS 1.99 ?


texts: How do I access layer attributes from within QGIS' manageR plugin?

texts: This is probably a fairly basic question, but searches for manageR come up with a lot of noise, and there's no manageR tag. What I'd like to do is load the attributes from a particular field of a layer in QGIS into a vector in manageR (equivalent of x <- c(1,2,3,4) if it was done manually). I can find a button to import layer attributes (when I press it, it shows > manageR import function), but I have no idea how to access them from within manageR thereafter. If it matters, the layer in QGIS is called Aspalathus and the field I'd like to access from R is called mean.


texts: Detecting what changes osmosis does on osm planet database?

texts:
I have already imported a planet osm file in my postgresql database and have now configured a daily update with osmosis.

Is there any way to find out what changes osmosis did in the database?

I use a call like this:

osmosis --rri workingDirectory=.replicate_daily --sc \
      --wpc user="dbuser" database="osm_planet" password="dbpassword"


texts:
I'm following this tutorial and installed the GRASS add on v.delaunay3d.

When I try to open this module with duble-click or enter nothing happens. It doesn't open. Does anyone have experience with this? Perhabs, I need to install another add-on to make this one work?
What could be a reason that nothing happens?

I'm using Windows 10 and GRASS 7.8.2

I tried to install it once more via the gui and added the option "Systemwide installation (perhabs systemadministration rights are needed)". Now I get the following error message when installing the extention:

  Unable to create 'C:\Program Files\GRASS GIS 7.8\docs\rest':

Perhabs that's the issue?


texts: How to put more than one overlay label in Openlayers layerswitcher?

texts:
I have two set of layers like 'Public' and 'Private'.Each set has 3 layers. My requirement is, Layer switcher has to show the first set of layers with check-box under the label name 'Public' and second set of layers with check-box under the label name 'Private'. [Not with Option button]. I have tried as shown below:

In Design:

In Javascript:

 //Layer Switcher
var layerSwitch = new OpenLayers.Control.LayerSwitcher({
    div: OpenLayers.Util.getElement('layerswitcher')
});
osMap.addControl(layerSwitch)

layerSwitch = osMap.getControlsByClass("OpenLayers.Control.LayerSwitcher")[0];
layerSwitch.dataLbl.innerText = "Public"

In that above list I need to add 'Private' label and layers. Please suggest me to implement this.Thanks in advance.


texts: Dealing with non-nested geographic units using the RQGIS and tigris R packages

texts:
I recently came across this tutorial suggesting that the RQGIS and tigris R packages could be used to overcome issues with non-nested geographies:

https://rpubs.com/corey_sparks/256942

I'm trying to apply this to some data I have where I would like to look at Census Block Groups nested within Zip Code Tabulation Areas. Specifically, I'd like to compute a segregation index using Census Block Groups as the lower units and Zip Code Tabulation Areas as the higher level units. As shown in the figure below, these are definitely not nested geographical units:

I am confused about how these R packages deal with this issue of non-nested units. Here's the explanation from the tutorial:

"In order to get around this problem [non-nested units], we can use the QGIS application to perform a geographic intersection between two spatial polygon layers that we want to use. This will allow us to merge the population data at the census tract level to a higher level, so we can calculate a segregation index."

Can anyone say more about how this is possible? I can run the code in the tutorial but I don't understand what it's doing.


texts: Working With Vector Product Format (VPF) - APIs, etc

texts:
I've been looking around the Internet for information about Vector Product Format. I want to put together a project that can read Digital Nautical Chart (http://msi.nga.mil/NGAPortal/DNC.portal), which is in the Vector Product Format, and manipulate the bathymetric data contained within it. I have had trouble finding an API that appears to have the capability to read the raw data, and allow me to work with it. Simply displaying imagery is not enough here; in honesty, the intent is to take that data and use it to terraform in Second Life, which is obviously off the topic of this website, but may give you an idea of what I need. If any sort of API comes to mind, or if there is a detailed specification of the Vector Product Format, that would be wonderful.

Edit: I should make clear that I have to use DNC; I haven't been given a choice.

Edit: Actually, that may not be true. I would like to do research on other databases, starting with GEBCO.


texts: CMV Viewer Custom Widget problem rendering

texts:
i'm trying to develop a custom widget into CMV Viewer. I'm using the guide line of CMV Viewer but i have some problem to render the html content set into templete folder.
This is my code:
Initialize widget:`

define([
"dojo/_base/declare",
"dijit/_WidgetBase",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"esri/SpatialReference",
"esri/dijit/PopupTemplate",
"WeatherResources/ClusterLayer",
"dojo/_base/array",
"dojo/on",

// templates & widget css
'dojo/text!./Storico/templates/Storico.html',
'dojo/i18n!./Weather/nls/resource',
'xstyle/css!./Storico/css/Storico.css',

'dijit/layout/LayoutContainer',
'dijit/layout/ContentPane',
'dijit/layout/TabContainer',
'dijit/form/Select',
'dijit/form/TextBox',
'dijit/form/NumberTextBox',
'dijit/form/Button',
'dijit/form/CheckBox',

"dojo/query",
"esri/graphic",
"esri/geometry/Extent",

"esri/Color",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/PictureMarkerSymbol",
"esri/renderers/ClassBreaksRenderer",
"esri/renderers/UniqueValueRenderer",
"esri/renderers/SimpleRenderer",
"dojo/_base/connect",

'esri/dijit/InfoWindow',
'esri/InfoTemplate',
"dojo/Deferred",
"dijit/layout/TabContainer",
"dijit/layout/ContentPane",
"dijit/Toolbar",
"dijit/form/Button",

"dojo/dom-style",
"esri/request",
"esri/geometry/Point",
"esri/geometry/webMercatorUtils",
'xstyle/css!./LayerControl/css/LayerControl.css'

], function(declare, _WidgetBase, _TemplatedMixin, template) {

return declare([_WidgetBase, _TemplatedMixin], {
    templateString: template
});
});

and this is my html cotent for structure widget:

            ${i18n.Labels.selectTipologia}:

            <select style="width:100%;" data-dojo-attach-point="selectLayerByAttribute" data-dojo-type="dijit/form/Select"></select>

              ${i18n.Labels.selectLivello}:

              <select style="width:100%;" data-dojo-type="dijit/form/Select">
                <option value="Uno">Livello 1</option>
                <option value="Due" selected="selected">Livello 2</option>
                <option value="Tre">Livello 3</option>
              </select>

Now i set in the viwer my widget:

storico: {
            include: true,
            id: 'storico',
            type: 'titlePane',
            canFloat: true,
            path: 'gis/dijit/Storico',
            title: 'Storico',
            open: false,
            position: 0
        }

but now when i try to open the widget into viewer doesn't show the html content that i write.


texts: Automatic attribution of one layer from another based on spatial relationship?

texts:
I have two layers with a 1:many relationship.  Working within ArcMap, I'd like to have that relationship somehow formalized so that when I add a new feature to the child layer, it automatically gets an attribute from the parent, so the link is automatically sustained.

For example, say I have a county layer and a site layer.  Sites are all within Counties and I want that site layer to have an attribute that indicates which county each site is within.  I want to be able to edit the site layer, adding a new polygon, and have that polygon automatically attributed with the county.

I thought for a moment that Relationship Classes in a File Geodatabase would do the trick... but I created the relationship class and tried adding a polygon to the site layer.  The relationship field remained Null.

Seems like a common need that should have an existing method...?


texts: How to correctly specify coordinate system?

texts:
Using QGIS v. 1.9 (1.7 does not seem to be available for Ubuntu Linux 12.04), do the following:

Create new project, specify coordinate system by clicking on button in bottom right hand corner, enable on the fly CRS transformation, set projection to WGS 84 / UTM Zone 18S. Pass mouse over project window and UTM coordinates appear in coordinates window in status bar at the bottom.
Add delimited text layer in decimal degrees. When asked for projection, specify same projection as in (1). Points in the layer are plotted but, mousing over the map, the coordinates in the coordinates window are now in decimal degrees (even though the projection is set to UTM).

Is there something I am missing here? I have tried doing this in so many ways, so many times, but the result is always the same. I seem to be setting the projection correctly but only decimal degrees show in the coordinates window.

With thanks, Martin


texts: Function to create buffers of different sizes in Google Earth Engine

texts:
I want to generate a function that allows me to generate buffers of different sizes for the same FeatureCollection. Consider the example below. Instead of repeating the code for buffers of size 100 and 200, I want to create a function that uses as input the sizes of the buffers.

var polygons = ee.FeatureCollection('xxxxx');

var bufferPoly100 = function(feature) {
  return feature.buffer(100);
};

var bufferPoly200 = function(feature) {
  return feature.buffer(200);
};

var bufferedPolys100 = polygons.map(bufferPoly100);
var bufferedPolys200 = polygons.map(bufferPoly200);


texts: Downloading Numerical Vertex Edit plugin for QGIS?

texts:
I cannot find the Numerical Vertex edit plugin in QGIS 3.6.

How can I download it or what is instead of this plugin in 3.6 version?


texts: How to retrieve the value of a cell in RasterLite?

texts:
Just wanting to know the SQL statement needed to find out the pixel value for a location, when the raster is loaded into SpatialLite as a Raster?

I loaded the Raster using rasterlite_load -d db.sqlite -T myRaster -f c:\mytest.tif

All seems fine... but how would I find the value for a cell at say (100,400)?

Thanks
Phil


texts: Get field name of shapefile geometry for using GeoDjango LayerMapping

texts:
I want to use LayerMapping to insert any shapefile to PostGIS. I insert the geometry only, into generic tables. For that i need a mapping between the shapefile field names and the django models field name, like in: the LayerMapping documentation. How can I do this dynamically?
I know i can do:

ds = DataSource(shapefile_directory)
lyr = ds[0]
print lyr.fields
['FIPS', 'ISO2', 'ISO3', 'UN', 'NAME', 'AREA', 'POP2005', 'REGION', 'SUBREGION', 'LON', 'LAT']

but that does not return the field name of the geometry. And

print lyr.geom_type
Polygon #Even if it actually is Multipolygon

only gives the basic geom type. I read in LayerMapping doc that for 'For geometry fields use OGC name', but then I need to know if the geom type is e.g 'MULTIPOLYGON' or 'POLYGON'. I would like something like this:
    field_name = lyr.geomfield

Edit:
I solved it by instead of having one DB-table for each of Multi-Point, -Poly and -Line, having one with a Geometry-field. Then I didn't need the LayerMapping-magic. I also got to know that the germ-field in a shapefile does in fact not have a field-name, so the solution I requested was not possible.


texts:
I'm trying to get the total area for a reprojected layer made by number of features selected by clicking on a layer with PyQGIS, but when I use iface.activeLayer().selectedFeatures() a list of QgsFeatures is returned, not a QgsVectorLayer, so I have to convert back again to QgsVectorLayer or add these features to a layer, but so far I haven't been able to find how to do this.

The code I've been using:

layer = iface.activeLayer().selectedFeatures()
parameter = {'INPUT': layer, 'TARGET_CRS': 'EPSG:32615','OUTPUT': 'memory:Reprojected'}
result = processing.run('native:reprojectlayer', parameter)
areatot = 0
for elem in result['OUTPUT'].getFeatures():
     geom = elem.geometry()
     areatot += geom.area()


texts: Merging different types (e.g., polygon with polyline) of shapefiles?

texts:
I want to create a watershed shapefile with areas, streams and pour points in it.

Is there a way to merge the areas (polygons) with streams (polylines) and pourpoints (points)?


texts: Creating dynamic layers on feature class for each unique value in field

texts:
I have a WORKORDER points FC that has a CLASSIFICATION field (Oracle 18c/10.7.1 GDB).
I want to automatically/programmatically create a dynamic layer in ArcGIS Desktop 10.7.1 for each unique value in the CLASSIFICATION field in the FC.
In other words, if there are values like POTHOLE, SIDEWALK GRIND, STM POND CLEANING in the CLASSIFICATION field, then I want to create separate layers that only include features where the CLASSIFICATION is:

POTHOLE (layer name is POTHOLE)
SIDEWALK GRIND (layer name is SIDEWALK GRID)
TREE PRUNING (layer name is TREE PRUNING)

And I want to make the symbols for each layer to be the same—a simple point that is a specific colour.

What would it take to automatically generate the layers from a field in ArcGIS Desktop?


texts:
I am working with a function that should display one image of roads, and OpenStreetMaps as background, with some functionality. But I can't figure out why my code isn't working - the URL works fine but when opening the HTML file it does not display any of the maps. The function (sorry for the indentation that got messed up when pasting):

<script defer="defer" type="text/javascript">
function init(){
    //The bounding box of wsNYCRoads:nyc_roads
    var extent = [-74.00083695216,40.7366919238975,-73.97236135813849,40.769490143183006],
    ol.proj.transformExtent(-74.00083695216,40.7366919238975,-73.97236135813849,40.769490143183006, 'EPSG:4326', 'EPSG:3857');

    //Initial view
    var view = new ol.View({
       center: ol.proj.transform([-73.99, 40.75], 'EPSG:4326', 'EPSG:3857'),
       zoom: 15
    });

    //The source for wsNYCRoads:nyc_roads
    var wmsSource = new ol.source.ImageWMS({
         url: 'http://flygbilder.gis.lu.se/geoserver/wsNYCRoads/wms',
         params: {
         'LAYERS': 'wsNYCRoads:nyc_roads',
         'VERSION': '1.1.0'},
          serverType: 'geoserver'
        });

    //OpenStreetMap background and wsNYCRoads:nyc_roads in layers
    var layers = [
       new ol.layer.Tile({
          source: new ol.source.OSM()
       }),
       new ol.layer.Image({
          source: wmsSource
       })
     ];
    //Bind the map object to our "map" div and add some extra functionality
    var map = new ol.Map({
         layers: layers,
         controls: ol.control.defaults({
         attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
         collapsible: false
       })
       }).extend([

     //Extra functionality of the map
     //Control for displaying coordinates

       new ol.control.MousePosition({
           coordinateFormat: ol.coordinate.createStringXY(4),
           projection: 'EPSG:4326',
           className: 'custom-mouse-position',
           target: document.getElementById('location'),
           undefinedHTML: '&nbsp;'
         }),

      //COntrol for displaying a scale line
       new ol.control.ScaleLine({
       target: document.getElementById('scale-line')
       }),

      //Control for zoming to a defined extent
      new ol.control.ZoomToExtent({
      extent: ol.proj.transform(extent, 'EPSG:4326', 'EPSG:3857')
    })
    ]),
       target: 'map',
       view: view
    });

    //Add click event for getting attributes from WMS
    map.on('singleclick', function(evt) {
     document.getElementById('nodelist').innerHTML = '';
    var viewResolution = /** @type {number} */ (view.getResolution());
    var url = wmsSource.getGetFeatureInfoUrl(
     evt.coordinate, viewResolution, 'EPSG:3857',
     {'INFO_FORMAT': 'text/html'});
     if (url) {
        document.getElementById('nodelist').innerHTML = '<iframe
            style="width:950px;border:none;" src="' + url + '"></iframe>';
    }
   });
}

GetCapabilities for layer nyc_road:

 </Layer>
 <Layer queryable="1" opaque="0">
    <Name>nyc_roads</Name>
    <Title>nyc_roads</Title>
    <Abstract>Hello</Abstract>
    <KeywordList>
      <Keyword>nyc_roads</Keyword>
      <Keyword>features</Keyword>
    </KeywordList>
    <SRS>EPSG:4326</SRS>

    <!--WKT definition of this CRS:
    GEOGCS["WGS 84",
    DATUM["World Geodetic System 1984",
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
    UNIT["degree", 0.017453292519943295],
    AXIS["Geodetic longitude", EAST],
    AXIS["Geodetic latitude", NORTH],
    AUTHORITY["EPSG","4326"]]-->

    <LatLonBoundingBox minx="-74.00083695216647" miny="40.7366919238975" maxx="-73.97236135813849" maxy="40.769490143183006"/>
    <BoundingBox SRS="EPSG:4326" minx="-74.00083695216647" miny="40.7366919238975" maxx="-73.97236135813849" maxy="40.769490143183006"/>


texts:
I have an problem with cut an hole in a shapefile with another shapefile in QGIS version 3.12, I have previously used 2.18 for this. But when i tried that function in 3.12 it happens absolutly nothing.

Function: "cut with selected polygon"


texts:
I am new to PostGIS - on windows 10. I have managed to install it and have a database with vector data working in QGIS.

I am now trying load raster data.  I have edited the PATH to point to Postgres folder.

I can login to my database from a command window but when i type the raster2pgsql command at the hash prompt - nothing happens.

This is an example of the commands;

raster2pgsql -s 3035 g100_06.tif public.c-100 |psql -d CORINE

What am I doing wrong?


texts: Modify Map Service Symbology via Esri JavaScript API

texts: I have a JavaScript application built on the Esri JavaScript API that is consuming a feature service and a tiled map service from ArcGIS Online.  I developed a widget that allows the user to change the symbology of the feature service layer.  Is it possible to change the symbology of the tile map service once it has been published?  I didn't see a way to do that in the ArcGIS Online Web Map Viewer.


texts: Use C# to display PostGIS data in ArcGIS Developer kit with arcgis-ogr plugin

texts:
I am trying to display data in ArcGIS Runtime Engine Developer kit 10.2.2 using OGRPlugin/OGRPlugin/ develop by Ragi Yaser Burhum on https://github.com/RBURHUM/arcgis-ogr . I am using this format but I am unable to get any result.
Can anyone be of help please.

        // Open workspace and feature class.

        IWorkspaceFactory wksf = new PostGisWorkspaceFactory();

        IPropertySet ps = new PropertySetClass();
        ps.SetProperty("server", "localhost");

        ps.SetProperty("database", "spatial");
        ps.SetProperty("user", "postgres");
        ps.SetProperty("password", "michael");
        ps.SetProperty("port", "5432");

        IFeatureClass fc = fwks.OpenFeatureClass("parcel");
        // Create the new layer (default renderer is ISimpleRenderer)
        IFeatureLayer layer = new PostGisFeatureLayer();
        layer.FeatureClass = fc;
        layer.Name = fc.AliasName;
        ILayer ly = layer as ILayer;
        IGeoFeatureLayer gfl = layer as IGeoFeatureLayer;
        //doSimpleRenderer(gfl);
        doUniqueValueRenderer(gfl);
        //IFeatureRenderer fr = new VerySimpleCustomRenderer();
        //gfl.Renderer = fr;
        axMapControl1.AddLayer(gfl as ILayer, 0);


texts: Connect to a SQL Server database from MS Access

texts:
I have an existing Microsoft SQL Server database which has been configured as an Enterprise geodatabase. I want to access it in MS Access in order to extract data to populate a form.  What is the proper way to connect it? I have an ArcGIS Enterprise connection file named:
"G:\Database Connections\eGIS_Cadastral on EGISDBP1 as viewer.sde"

So far I went to new data source > from other source > odbc database and chose Link data source. It now wants a file data source. What is that?

Here is an image on where I am stuck:

This is an image of the connection properties in ArcMap: