texts: How to create an ArcObjects point with latitude and longitude?

texts:
I need to add a point in an existing feature class using .NET API of ArcGIS Server 10 in C# (Visual Studio 2008). I'm using a sample from ESRI Resource Center (ArcGIS_SimpleEdit_CSharp). The following shows the portion of the code that creates the new point using X/Y coordinates.

ESRI.ArcGIS.Geometry.IPoint aoPoint =
    serverContext.CreateObject("esriGeometry.Point") as ESRI.ArcGIS.Geometry.IPoint;
aoPoint.PutCoords(actionRecord.Location.X, actionRecord.Location.Y);

...

// Create a feature and set its geometry and attributes to those specified by the
// passed-in action record
ESRI.ArcGIS.Geodatabase.IFeature feature = featureClass.CreateFeature();
feature.Shape = aoPoint;
feature.set_Value(featureClass.FindField("Name"), actionRecord.name);
feature.set_Value(featureClass.FindField("LocationId"), actionRecord.id);
feature.set_Value(featureClass.FindField(actionRecord.id), "1");
int trackingNumber = feature.OID;

// Commit the new feature to the database
feature.Store();
workspaceEdit.StopEditOperation();
workspaceEdit.StopEditing(true);

But I need to use Latitude and Longitude (with decimal precision) instead of X/Y coordinates. How can I do that? Can I just use lat/lon instead of X/Y? Or I have to convert lat/lon to X/Y before assigning feature.Shape?


texts: Are there any standards for geocoder APIs?

texts:
I recently did some research on geocoding services, and noticed that seemingly every API is unique. Unique in both the request format and the results returned. However, the general functioning of most of the services is fairly similar.

Hence: Do there exist any standards for geocoding services? (Obviously, they are not in widespread use, but I wonder if any have actually been proposed, by the OGC or anyone else.)


texts:
I am trying to get the GPS data from several hundred PNG photographs for display in Q GIS (so need to access the EXIF data).

The online and downloadable viewers I have tried haven't yielded much information:

Do the photographs not contain any GPS info ( I am told that they do) or is there a different way of extracting the information?


texts:
I'm using ArcGIS 10.3.1 Standard License.

I have a legend item that I would like to split across two columns. Below is the output.

What I would like to have is the top of the second column align with the top of the first column.  So that boxes A and C are aligned.

My current settings are:

and

and

Converting the legend to graphics is not an option for me.


texts: QGIS 2.14.5.LTR Gdal-Tools execution problem

texts:
I have installed QGIS 2.14.5.LTR via the OSGeo4W installer on Windows2008R2. No raster tools are available. After activating Gdal-Tools plugin, the raster tools are available, but cannot executed (because Gdal-Paths are not set?):

In the dialog under menu Raster > GdalTool-Settings... the paths to GdalTools can be set but C:\OSGeo4W\bin where these modules reside (gdalbuildvrt.exe e.g.) has no effect.

On the other hand, GdalTools via the processing toolbox can be executed without any problem:

I have no idea wether here is something wrong with my path settings or if it is an issue with the OSGeo4W installer. Any Ideas?


texts: Decimal degrees buffer displayed incorrectly?

texts: I would like to create a circular buffer with a radius of 2 decimal degrees around various points. However, after using the buffer tool under geoprocessing, I noticed that the buffers were perfectly circular when they should be various ellipses depending on the location of their respective points. An answer to a similar question shows the buffers created as ellipses. So, I am confused as to why my buffers are circular? I tried changing the method from Planar to geodesic, but the result still seems the same. The points were inputted as GCS_WGS_1984.


texts: D3: center a map feature using correct latitude and longitude, without rotation?

texts:
The following is a map of Chicago which I've created in D3.js, and the JS code to render it.

I had a very hard time centering Chicago within my viewfinder (the white box).  After much trial and error, I was finally able to make it work, with the long/lat of [8.25, 41.88205] and a rotation of [92.35, .5, -4], using the Albers projection.  This seems weird to me, since the long/lat of Chicago should be [87.627815, 41.88205].

So, my questions are: what is up with the 8.25 longitude?  Why doesn't D3 center Chicago on my screen simply with the long/lat of [87.627815, 41.88205]?  And why do I need to apply the rotation at all?

BTW, the community_areas_sm.geojson file comes off the City of Chicago website, and contains correct long/lat values.

<script>
var width = 600,
    height = 750

var svg = d3.select("#map").append("svg")
    .attr("width", width)
    .attr("height", height)

var map = d3.json(
    "/static/data/community_areas_sm.geojson", function(error, map) {
        if (error) return console.error(error)

        var proj = d3.geo.albers()
            .center([8.25, 41.88205])
            .parallels([40, 45])
            .scale(105000)
            .rotate([92.35, .5, -4])
            .translate([width / 2, height / 2])

        svg.selectAll("path")
            .data(map.features)
            .enter().append("path")
            .attr("d", d3.geo.path().projection(proj))
        }
    )
</script>


texts: Adding JSON layer in Leaflet just like GeoJSON data?

texts:
I am trying to add different layers to a leaflet map. Now i really want these layers in order to add features like zoom. With GeoJSON file this was easy but I am not getting a good way to plot array data from JSON response of this sort [[1,2],[ 3,4],[5,6]] :

So basically my question is how can I group latlng points together to form a layer equivalent to how layer is provided in L.geoJson.

I have done some work in this direction:

placePointsOnMap(){
        let markerParams = {
            stroke: true,
            radius: 3,
            fillColor: 'blue',
            color: 'black',
            weight: 2,
            opacity: 1,
            fillOpacity: 1,

        };
        for(let i of this.state.points){
            console.log("ii", i);
            L.circleMarker(i, markerParams).addTo(this.miniMap);
        }
    }

But this is not how I want points to be displayed, instead I want this to be a part of layers feature provided by leaflet allLayers = L.layerGroup([]);

this.geojsonPointsLayer = L.geoJSON(this.state.geoJSON, {
            onEachFeature: this.onEachFeatureFunction.bind(this),
            pointToLayer: this.pointToLayerFunction.bind(this),
            filter: this.filterPointsAsRequired.bind(this)
        });


texts:
I am working in QGIS.

Is there a way you can lock the metadata so that no one can edit or change anything except me?


texts:
I am dealing with this issue more than 2 month and i am hoping that some one have a lead for me.
I am using Openlayers to show some vectors layers like buildings, points, gardens and more layers that i got from the government data, and i got shp file of all the streets from OpenStreetMap.
I want to show everything together so the streets will suite to all the other vector layers.
I am using Geoserver to show all the layers with WMS, my layers projection is ITM (Israel) and the OpenStreetMap layers is the google projection.
when i show everything together the street layers is shifting little bit and its look like this:

as you can see the layers are not as it should be... and its happening also with the others layers from openstreetmap like buildings etc.
I searched all over the internet and i didnt found solution... hope some one will help me...


texts: Merge nearby points from two shapefiles in QGIS

texts:
I am working with 2 shapefiles: points from one datasource and another. Some of the features are duplicates. However, since data quality in the second datasource is not as good as in the first one, duplicate points are slightly offset. The offset depends on the particular point, so it varies from 3 to 20 meters.
1st datasource, let's call it "GOOD" has more points than another. The 2nd datasource, "BAD", contains much less. It means that if I have building with 3 points from "GOOD" dataset and 1 point from "BAD", when the "BAD" point is located between 3 and 20 meters to any of the 3 GOOD points, it is called duplicate. The example is below.

The naive algorithm I suppose:

For each BAD point find the closest GOOD point.
If the associated GOOD point is between 3 and 20 meters and doesn't associated with another BAD point, then remove BAD point and leave only GOOD one in the merged shapefile.
If there are several BAD points associated with the GOOD one, than remove the closest BAD point and find another GOOD point for the left BAD points. Repeat 2).
If GOOD point isn't associated with any left BAD points in distance between 3 and 20 meters after 2) and 3), than leave GOOD point in the merged shapefile.
If BAD point isn't associated with any left GOOD points in distance between 3 and 20 meters after 2) and 3), than leave BAD point in the merged shapefile.

Talking about the example, I want to get merged shapefile with 2 points in the bottom building (1 GOOD point and 1 *GOOD& point associated with BAD one) and 2 points in the top building (2 GOOD points associated with 2 BAD points). Left 2 GOOD points are alone so I leave them in the merged shapefile.
UPD: I don't have any point attributes except geometry.


texts:
I got the typical cross-domain problem when access to WFS layer by using openlayers,

XMLHttpRequest cannot load http://XXXX/geoserver/ows?service=WFS. Origin http://XXXX is not allowed by Access-Control-Allow-Origin.

I did some research about how to handle this. it seems that a web proxy solution is a good. so I edited a proxy.py file, and put it at the root of my IIS server. however, it seems that I need to explicitly put the following code somewhere:

Openlayers.ProxyHost = "/cgi-bin/proxy.py?url"

but I don't know where to put. If I put like below:

var map;
Openlayers.ProxyHost = "/cgi-bin/proxy.py?url"

Ext.OnReady(){
   //more code
 }

It will popup an error saying "OpenLayers is not recognized".

Any hints? thank you all!


texts: POI database of tourist attractions, or POI database with popularity index

texts:
I'd like to build a list of popular points of interest and tourist attractions for many/every city in the world. Is there any sort of dataset that I can use for this which either contains only popular attractions, or something like the OSM data with a popularity index that I can filter through myself? Open or Free is preferable.

I've tried playing with FourSquare's API, but it is against their TOS to save any of their data for longer than just caching. It was also common for things like a Starbucks to appear in the list of most popular locations, but this wouldn't be too troublesome to work around. (I guess because more people want to check-in at Starbucks than a Museum).

I'm looking through OSM at the moment, but there doesn't seem to be any indication of the popularity or importance of a POI. The tags are nice, but not very helpful to me if there is no way to differentiate Disney World from a touristy taco-shack.

Thanks in advance for any help or direction.


texts: Error in export image from Google Earth Engine

texts:
I would like to export the image from the Google Earth Engine. However, it had
Error: Export region contains no valid (un-masked) pixels. How to fix this error? This is the link of my google earth engine code:
  https://code.earthengine.google.com/707b7d4b84a0e14f0db74b38533666e6.
The code is as follow:

    // Load a Fusion Table of state boundaries and filter.
var fc = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw')
    .filterMetadata('Country','equals','New Zealand');
// Load Landsat 8 imagery and filter it
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
            .filterBounds(fc).set('SENSOR_ID', 'OLI_TIRS');
var filtered = collection
  .filterMetadata('CLOUD_COVER', 'less_than', 10);
// Function to cloud mask from the Fmask band of Landsat 8 SR data.
function maskL8sr(image) {
  var cloudShadowBitMask = ee.Number(2).pow(3).int();
  var cloudsBitMask = ee.Number(2).pow(5).int();
  var qa = image.select('pixel_qa');
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
      .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask).divide(10000).float();
}
// Map the function .
var filtered_1 = filtered.map(maskL8sr);
function a(image) {
  var equation = image.expression(
    '(7.27 * B4/B3) - 1.7',
    {
        B3: image.select('B4'),
        B4: image.select('B3'),
    }).rename('NEW_A').float();
  return image.addBands(equation);
}
var b = filtered_1.map(a).median();
print (b,'NEW_B');
// Display the results.
var vizParams = {bands: ['NEW_A'], min: 0, max: 100};
Map.addLayer(b, vizParams, 'recent value composite');
// Export the image, specifying scale and region.
Export.image.toDrive({
  image: b,
  description: 'NEW_B',
  scale: 30,
});


texts: How to avoid updating PATH by copying SIP module to appropriate directory

texts:
I continue to have very time-consuming problems with import statements in the Python scripts that I attempt to write.

In this particular script, I want to use QGIS functionality, and so it begins:

from qgis.core import *

which causes:

Traceback (most recent call last):
  File "C:\Python script for PUI\v20170621.py", line 8, in <module>
    from qgis.core import *
ImportError: No module named qgis.core

So I try:

import sys
sys.path.append('C:/Program Files (x86)/QGIS 2.18/apps/qgis/python')

from qgis.core import *

which causes:

Traceback (most recent call last):
  File "C:\Python script for PUI\v20170621.py", line 8, in <module>
    from qgis.core import *
  File "C:/Program Files (x86)/QGIS 2.18/apps/qgis/python\qgis\__init__.py", line 26, in <module>
    from qgis.PyQt import QtCore
  File "C:/Program Files (x86)/QGIS 2.18/apps/qgis/python\qgis\PyQt\QtCore.py", line 26, in <module>
    import sip
ImportError: No module named sip

There is a folder named 'sip' in 'C:\Program Files (x86)\QGIS 2.18\apps\python27' and so I try:

import sys
sys.path.append('C:/Program Files (x86)/QGIS 2.18/apps/qgis/python')
sys.path.append('C:/Program Files (x86)/QGIS 2.18/apps/python27')

from qgis.core import *

which again causes the 2nd error above:

Traceback (most recent call last):
...
ImportError: No module named sip

I suspect that I have a very fundamental misunderstanding about how modules/libraries are installed/imported/loaded/etc.  Why can I not simply copy the necessary folder(s) (for instance, the folder 'sip' in this case) to some folder in 'C:\Python27\ArcGIS10.1' (which is where the 'python.exe' file is located that IDLE calls when I open and execute the script) so that no update to PATH nor PYTHONPATH is required?


texts: Simplifying a feature class to feature class ETL using multiple input feature classes with varied schemas

texts:
I'm wondering if anyone can help me brainstorm how to simplify this ETL process? The way I have it written, it just feels very repetitive, but I can't think of a way to avoid the repetition.

I'll eventually be feeding about a dozen feature classes, all with a different schema (different field ordering, field spellings, etc.), into one composite feature class. I've pre-determined the proper index values for each field, and as you can see, the ordering (and as I said, the spelling of field names as well) are wildly different between "fc1" and "fc2," which makes it hard to automate, thus the problem.

I'm afraid that with so many feature classes being added, the code will eventually get unnecessarily long. This example has been abbreviated by quite a lot.

I have modified the code for simplicity and confidentiality:

import arcpy, os
from arcpy import env

arcpy.env.workspace = r"I:\GIS_TOOLS\SDE_connections\gis_sde.sde"
sde = arcpy.env.workspace

masterFC = os.path.join(sde, "sde.SDE.masterFC")
fc1 = os.path.join(sde, "sde.SDE.FC1")
fc2 = os.path.join(sde, "sde.SDE.FC2")

masterFCFieldList = ["Shape", "Id", "Name", "Address", "Zip", "Boro", "Phone"]

# ---- Load feature class 1 ----

insertCursorMasterFC = arcpy.da.InsertCursor(masterFC, masterFCFieldList)
searchCursorFC1 = arcpy.da.SearchCursor(fc1, *)

for row in searchCursorFC1:
    Shape      =   row[9]
    Id         =   row[5]
    Name       =   row[1]
    Address    =   row[2]
    Zip        =   row[4]
    Boro       =   row[3]
    Phone      =   row[6]
    insertCursorMasterFC.insertRow([Shape, Id, Name, Address, Zip, Boro, Phone])

del insertCursorMasterFC
del searchCursorFC1

# ---- Load feature class 2 ----

insertCursorMasterFC = arcpy.da.InsertCursor(masterFC, masterFCFieldList)
searchCursorFC2 = arcpy.da.SearchCursor(fc2, *)

for row in searchCursorFC2:
    Shape      =   row[8]
    Id         =   row[1]
    Name       =   row[5]
    Address    =   row[3]
    Zip        =   row[7]
    Boro       =   row[2]
    Phone      =   row[4]
    insertCursorMasterFC.insertRow([Shape, Id, Name, Address, Zip, Boro, Phone])

del insertCursorMasterFC
del searchCursorFC2

print "Script Complete."


texts: Why I see different data from PostGIS and ArcSDE

texts:
I have installed ArcSDE 10 on PostgreSQL 8.4.3 with PostGIS 1.4.2. I did some tests.

I imported one feature layer with 8500 features into ArcSDE through ArcCatalog.  and I deleted 8499 features in ArcMap and just kept one. I saved the edits. I checked the data using PostgresSQL client tool, like pgAdmin III. I still see 8500 rows in the table.
I imported one feature layer with 3 point features into ArcSDE through ArcCatalog.  and I add 2 new points in ArcMap. I saved the edits. So I can see 5 points on this layer. But when checked the data pgAdmin III. I still only 3 rows in the table.

I closed and opened ArcMap and pgAdmin several times. and still see they have different data. Is anything I did wrong?


texts: Create network graph from contiguous polygons in KML, or PostGIS?

texts:
I am using Postgres 9.5 and PostGIS. I have a table with a geometry field. This table has about 200 rows, in each of which the geometry field contains a Polygon.

I would now like to derive an undirected network graph from these rows, in which row is a node, and there is an edge between them if they share a boundary.

Is it possible to derive this somehow?

I also have the data in KML form, if that helps, and I think NetworkX can accept shapefiles.


texts: Google Maps Decodepath change variable name

texts:
I have this code:

    var directionsService = new google.maps.DirectionsService();

    var request = {
      origin : start,
            destination : end,
            travelMode : google.maps.DirectionsTravelMode.DRIVING
    };

directionsService.route(request, function(response, status) {
    var coords;
    if (status == google.maps.DirectionsStatus.OK) {
        coords = google.maps.geometry.encoding.decodePath(response.routes[0].overview_polyline.points);
        callback(coords);
    }
});

Yesterday the decodePath brought coordinates whose name of variables was Ya and Za, today became hb and ib. Why?


texts: Access MBTiles png and json using tilestache?

texts:
I've got a Tilestache server running locally with an MBTiles source file. I can get the PNG tiles without problem, but I'm having a hard time figuring out how to also get the UTFgrid.

Is it possible to use Tilestache to access the UTFgrid as well? Maybe by creating two layers in the config file?

Or should I be investing my time into looking at another tile server like Tile Cloud or something else? I'd prefer it be a python based solution.


texts: How to get average values per coordinates in ArcMap/R?

texts: I have a point shapefile. It has multiple points at different spatial locations. Within each point there are multiple values that I want to get the average of. In this case the new file would have one value per point.


texts: I am wanting to project a basemap focusing on the Arctic. Currently I am using QuickMap Services / XYZ tiles as the basemap and projecting the map to EPSG:3995 WGS 84 / Arctic Polar Stereographic. However doing this causes a large hole in the centre of the Arctic ocean - how can I work around this to display the ocean seamlessly?


texts: Converting graphics to features in ArcGIS Desktop using ArcPy?

texts:
Is there a way to convert a graphic to feature, i.e. use the "Convert Graphics to Feature" tool on the toolbar, within an ArcPy script?

I need to use a graphic as a selectbylayer feature, so either converting it or using the graphic directly would be nice.


texts:
What to do to only center of the circle became transparent?
also I want see the red outline *


texts: I am trying to locate areas upstream and downstream of a point of interest in QGIS in order to determine possible areas of origin upstream and areas of impact downstream.  I have used a DEM to create watersheds and am now using the SAGA Upslope Area tool.  I have populated the X and Y fields with the coordinates of a dummy point and used the filled DEM for the Elevation field.  When I run the algorithm, however, the result is always the entirety of whatever I selected for the Target Area field.


texts: How to find boundaries with Fuzzy logic and GIS

texts:
How can I use Fuzzy logic in order to find the boundaries of an area with points? Is there a GIS software that does it? I would prefer Arcgis.

example from scholar pedia

Figure 1: Bird's-eye view on a forest: Where is the boundary of the forest? Which location is in the forest and which is out of it? (image from: http://www.scholarpedia.org/article/Fuzzy_sets#example)


texts: Filtering information in two attribute tables using QGIS?

texts:
I'm an amateur in QGIS so please forgive me for not using the correct definitions. I have a polygon map (shapefile) with the neighbourhoods of my city. Each one of this neighbourhoods has it's own identifier, name and other information columns in the attribute table.

In the other side, I have other layers that are just X and Y coordinates from, for example, schools in this city. I need to find the neighborhoods of these coordinates but I've found no way to do it. I can't filter both information (neighborhood and coordinates) since they're different layers.

Of course it can be done manually, but I think there's a way to do it in a quick manner.

I've searched GIS SE but I haven't found anything about it.


texts: Combining properties of two FeatureCollections that have same Features in Google Earth Engine?

texts:
This is throwing me for a loop, yet it seems so simple. I have two FeatureCollections that have the same features (but different properties), as they were generated by reducing over the same ImageCollection. I would like to combine the properties of these two FeatureCollections into a single FeatureCollection for export.

Here is a dummy script I put together--I'm using the Python API and my actual use case is quite involved, so I'm just showing this simple case.

I have tried an inner join (returns 4 features rather than just two), and a merge() (also return 4 features instead of two)--both are shown in the example code. Neither produces the expected output: a FeatureCollection with two features (defined by the image ids) and two properties ('date', and 'npix').

I am guessing that one likely answer is to combine the mapped functions into a single function and return a feature that contains all the properties I want to combine, but my workflow is quite involved at this point and it would be much simpler if I could just join the FeatureCollections.

Here is a code snippet to illustrate where I am stuck:

var start_date = '2010-01-01';
var end_date = '2019-01-01';
var scale = 30;

var feat = test_rois.first()

// Filter sensor collection by date and region
L8 = L8.filterDate(start_date, end_date).filterBounds(feat.geometry());
L8 = ee.ImageCollection(L8.toList(2)) // only keep two images for testing

// Dummy function for getting image dates as features
var dateadd = function(image){
  var date = image.date().format('YYYY-MM-dd');
  return ee.Feature(null, {'date':date})
}

// Dummy function for computing total number of pixels within polygon
var n_total = function(img) {
  var npix = img.select('B1').reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: feat.geometry(),
  scale: scale,
  });
  return ee.Feature(null, {'npix':npix.get('B1')})
};

// Map over the ImageCollection
var date_fc = L8.map(dateadd);
var npix_fc = L8.map(n_total);

// Look at results
print('Date Featurecollection', date_fc)
print('Npix Featurecollection', npix_fc)

// Attempt a join
var toyFilter = ee.Filter.equals({
  leftField: 'id',
  rightField: 'id',
});

var innerJoin = ee.Join.inner('primary', 'secondary');
var toyJoin = innerJoin.apply(date_fc, npix_fc, toyFilter);
print('Inner join toy example:', toyJoin);

// Attempt a merge
var merged = ee.FeatureCollection(date_fc).merge(npix_fc)
print('Merged:', merged)


texts: Using Shortcut for QGIS Processing Script?

texts:
I grabbed code from Assign shortcut to a script? to assign shortcuts for quickly changing to preset scales.
When I did it for one shortcut, it was working - but then, when applying several ones it didn't anymore - though the script runs without any errros..
Clues, anyone?

# https://gis.stackexchange.com/questions/168562/assign-shortcut-to-a-script/168739
#====================================
##[User scripts]=group
#====================================
from PyQt4.QtGui import QShortcut, QKeySequence
from PyQt4.QtCore import Qt
from qgis.core import *
from qgis.utils import *
from processing.gui.CommanderWindow import CommanderWindow

canvas = iface.mapCanvas()

def chgScale2500():
    canvas.zoomScale( 2500 )

def chgScale5000():
    canvas.zoomScale( 5000 )

def chgScale10000():
    canvas.zoomScale( 10000 )

#Assign "Ctrl+1", "Ctrl+2", .. to chgScaleX
shortcut1 = QShortcut(QKeySequence(Qt.ControlModifier + Qt.Key_1), iface.mainWindow())
shortcut1.setContext(Qt.ApplicationShortcut)
shortcut1.activated.connect(chgScale2500)

shortcut2 = QShortcut(QKeySequence(Qt.ControlModifier + Qt.Key_2), iface.mainWindow())
shortcut2.setContext(Qt.ApplicationShortcut)
shortcut2.activated.connect(chgScale5000)

shortcut3 = QShortcut(QKeySequence(Qt.ControlModifier + Qt.Key_3), iface.mainWindow())
shortcut3.setContext(Qt.ApplicationShortcut)
shortcut3.activated.connect(chgScale10000)

# for resetting shortcuts
#shortcut1.activated.disconnect(chgScale2500)
#shortcut2.activated.disconnect(chgScale5000)
#shortcut3.activated.disconnect(chgScale10000)


texts:
I am experimenting with the OGR OpenFileGDB zip file format in QGIS 2.8.1 on Windows 8.1 x64 and although OGR says it can happily read the format (with a couple of Code Page warnings) I am unable to load the data into QGIS -

  C:\Data\Vector>ogrinfo -ro -so data.gdb.zip

  Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No
  such file or  directory".
  Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No error". Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No error".

  INFO: Open of data.gdb.zip'
        using driverOpenFileGDB' successful.

  1: Cadastral_data (Multi Polygon)

  2: State_controlled_roads_surveyed_centreline (3D Multi Line String)

  3: Survey_Control (Point) 4: Coastline_and_State_border (Multi Line String)

In QGIS using the Add vector Layer and VSI ogr filehandler/driver I am able to select the data.gdb.zip file, but the dialog then responds with -

I am guessing the Warnings are serious enough to make the datasource invalid, so I tried creating a new zipped, FileGDB using OGR2OGR on a simple SHP file but I get the same error.

I am able to load the raw/unzipped gdb directory successfully using either the ESRI FileGDB or OpenFileGDB driver.

Would anyone be able to recommend a solution please ?


texts: GeoServer not logging in custom directory

texts:
I'm having trouble getting GeoServer to create audit logs outside its own directory. I'd prefer (possibly need) to do it this way as I'm getting a script to read them via FTP, which can't read from the GeoServer directory

If I set the monitor.properties to be inside the GeoServer directory, it all works happily

[root@maps geoserver]# ls -l /var/lib/tomcat/geoserver/webapps/geoserver/
total 56
drwxr-xr-x  2 tomcat tomcat 36864 Aug  5 10:45 logs

If I try and set it elsewhere, it doesn't want to work. I've tried changing the owner and even directory permissions to 777, but still nothing appears here. Oddly enough nothing appears in the normal GeoServer logs about this either, with development logging enabled.

[root@maps geoserver]# ls -l /home/shape_uploads/
total 8
drwxrwxrwx 2 tomcat        tomcat        4096 Aug  5 08:26 geoserver_logs

Here's my monitor.properties file:

# the storage mode, one of: memory, hibernate
# Note: hibernate mode requires the hibernate extension
storage=memory

audit.enabled=true
audit.path=/home/shape_uploads/geoserver_logs
#audit.path=/var/lib/tomcat/geoserver/webapps/geoserver/logs
audit.roll_limit=100

# the monitor mode, one of: live, history
mode=history

# synchronization mode, one of: sync, async, async_update
#
# WARNING: this is an advanced configuration option. You probably do not want
# to change this unless instructed to by a developer
sync=async

# The maximum allowable length for a request body (in bytes).  Longer bodies will be trimmed to
# this length.
maxBodySize=1024

# Disable logging of bodies entirely
# maxBodySize=0

# Allow unlimited body lengths.  This could take up a lot of space quite rapidly.
# maxBodySize=-1

# If you increase or unbound the maximum body length, you must also change the hibernate mappings
# file.

# The CRS to log bounding boxes in
bboxLogCrs=EPSG:3857

# Bounding Box Log Level: controls when to record bounding boxes.
# 'none': Don't record bounding boxes
# 'no_wfs': Record bounding boxes for WMS and WCS requests, but not WFS.  This is the default
# 'full': Record a bounding box for all requests for which one can be produced.  WFS is not amenable
#         to being logged this way so the boxes produced will be approximate at best.
bboxLogLevel=full

Am I doing something obviously wrong, or is it not possible?

We're running on CentOS with tomcat if that makes any difference


texts:
I have a polyline shapefile with the following attributes: start elevation, end elevation, slope and length. I need to split the lines at a specific elevation, using ArcGIS. Essentially, if my line
start elev at 79.38m
end elev at 79.19
length of 144m
slope of 0.00132

How can I split the line at an elevation of 79.25m? Is there a tool in ArcGIS  that will interpolate the line based on the available information and split the line at the location where 79.25m occurs?


texts: How to automate creating box (rectangular) polygons in ArcGIS for Desktop?

texts:
Can anyone suggest a way to automate creating rectangle shaped polygons in ArcMap?

If I had many 30m x 60m rectangles to digitize and I just want to click a starting corner coordinate on screen, then a second click for orientation.

Is this more suited towards Python, or ArcObjects, etc..


texts:
I have a webpage with a Leaflet Map, I can add markers,filter markers and so on. My question is that how can I save it?

Load the Map
Add some Markers on the Map
(Optional) Filter the Markers on the Map
Save the map together with the Markers that put on the map in a database(any possible storage)
Opening the map in the browser and view same as what i just saved.

I've search everything but its too hard to do it any possible suggestions?


texts: Extract human-relevant data in an OpenStreetMap dump?

texts:
I downloaded a full XML dump. While there are lots of nodes and ways, I want to filter out only the human-relevant data.

By human-relevant, I mean neighborhoods, restaurants and landmarks are prefered over telephone poles, junctions, survey artifacts etc which are included in the full result set.

For example, the  nominatim.openstreetmap.org/reverse service returns homes and other human-relevant places for a given (lat,lon) coordinates, while a dataset may return ways, relationships or irrelevant data.

What is the right criteria for filtering human-relevant nodes from the XML? My best guess is to filter  out only nodes and to check if they have attributes with addr: prefixes


texts: Can Geoserver pass visibility information to Accumulo

texts: I have created a plug-in which allows my Geoserver to retrieve data from an Accumulo datastore.  I want to enable the visibility cell in Accumulo to only return data based on information that the Geoserver received about the user's visibility access.  Has anybody ever come across a similar problem or have an idea on how to solve this?


texts:
Why does a shapefile with CRS WGS_1984_UTM_Zone_22N in ArcGIS have a different prj file than the EPSG:32622:WGS 84 / UTM zone 22N  WKT ?

Can I replace the ArcGIS .prj file with  EPSG:32622 WKT?

GS_1984_UTM_Zone_22N  prj file

  PROJCS["WGS_1984_UTM_Zone_22N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-51.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

WGS 84 / UTM zone 22N WKT

  PROJCS["WGS 84 / UTM zone 22N",GEOGCS["WGS
  84",DATUM["WGS_1984",SPHEROID["WGS
  84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],AUTHORITY["EPSG","32622"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]


texts: Is there a way to remove a GraphicsLayer from the map? - ArcGIS JS API 3.27

texts: I am attempting to remove a GraphicsLayer that was added into the map. This GraphicsLayer was added with var resultsGraphics = new GraphicsLayer({ id: 'resultsGraphics' }); after a map tool is opened, and needs to be removed when the tool is closed. I have tried map.removeLayer('resultsGraphics') which doesn't work, and baffles me that it doesn't because map.getLayer('resultsGraphics') works just fine.


texts: Alternatives to Google Maps on an Android phone

texts:
An Android phone has Google Maps as its stock/default maps, POI and navigation app. What are other options that I have which can be used instead of Google Maps?
One obvious answer is OsmAnd. OsmAnd has some cool features and also offline POI search and navigation.
Similarly from the talks in 2013 SOTM I discovered Hikar which has some cool integration of routing and augmented reality.
What other such apps are out there?
I know that there is a similar post for Android, but the list there is mainly for data collection apps. I am curious about the application side. Apps that have simple map viewing POI search and query, routing and navigation.


texts: Changing PostgreSQL table to support PostGIS

texts:
I have a PostgreSQL database which there is the table have lat & long columns. The PostgreSQL does install the PostGIS extension.

How can I change the table with lat & long columns to support PostGIS?

How can I add the the_geom column?

I would like to access this table by using QGIS finally!


texts: Updating Fields with values from Python list using ArcPy UpdateCursor

texts:
I'm currently trying to update the fields of a shapefile, with a list I've compiled outside of the arcpy environment. Trying both UpdateCursor which I can't seem to get to work, and FieldCalculator. FieldCalculator just updates it with "P[2]"
photoname = []

for p in shp_list:
    name = p[2]
    photoname.append(name)

    # arcpy.CalculateField_management(out_shapefile,"PhotoName","'p[2]'","PYTHON_9.3")

I've also tried:
updt_cursor = arcpy.da.UpdateCursor(out_shapefile, fields)
for row in updt_cursor:
    val = str(row[0])
    for p in shp_list:
        if val in p:
            row[2] = p_name
            updt_cursor.updateRow(row)

And UpdateCursor is blank.
I know I could create a .txt from the list, then update the fields with the line in the .txt file with InsertCursor, but I feel like there should be a more efficient way to do this. For context, I'm creating point shapefiles of the X/Y from the exif data, and want to fill in the corresponding image name.


texts: ArcObjects : How to identify ITool.OnMouseUp method execution

texts:
In ArcMap, I have a tool that inherits BaseCommand. The tool enables the user to draw a graphic on the screen.

I activated this tool (set as current tool) from a Windows UserForm by getting its reference using ICommandBars.find method.

Now how can the windows form get a notification when the ITool.OnMouseUp method is complete? I see that there are no events generated by the ITool interface.


texts: Calculate near distance for each meter of 22k stretch

texts:
I have the following data:

possible locations of Tunnel Boring Machines(TBMs) in point form (green/purple points with 1 meter distance along the 20+ km tunnel line)
the location of nearby buildings in orange points

While the TBMs are on the move, I want to be able to select building points within 200 meters, after I have stated a specific location for the TBMs. I have run the Near 3D tool on the buildings, getting the shortest distance to the tunnels, but I'd like to know which buildings are within 200 meters of each tunnel point so when I can see that the TBM is at a certain point, I can quickly get the building points nearby.

But there are around 22 000 points along each of the two tunnel lines, so how can I do this without running the Near 3D tool 44 000 times?

I'd like to have this all in one table, so that my colleagues can query the table without knowing how to use arcgis.

Is there an easy way to do this that I haven't realised yet?


texts: Reprojecting a raster DEM from meters to feet using QGIS?

texts: Is there a tool in QGIS that does the same as reprojecting a raster DEM from meters to feet as in ArcGIS's 3D Analyst > Raster Math > Times ?


texts: Esri ArcObjects - getting geometry directly from SHAPE value ID

texts:
I've been teaching myself ESRI ArcObjects in C# over the past few weeks, I'm still very new in the ArcObjects world.
All of our data is in an Enterprise geodatabase on a MS SQL Server database.
I've been able to open the SDEWorkspace, iterate through said workspace datasets and eventually come to the feature class. I get the IFeatureCursor, iterate through that, find the IFeature object that I want to query via comparing the OID and then cast its IGeomertry Shape to IPoint, IArea whatever it is and pullout coodinants and fiddle with them.
I do have this problem where users will create new objects throughout that day but they will be inaccessable until they post and the database is compressed.
I know how the versioning all works on a database level, but I don't know how to get that latest data out of the geodatabse before a post.
I can however find the SHAPE value ID within the version tables of the database, is there a fast way to just jump to a IGeometry Shape class if I know the Shape ID thats listened from within the database table.
For example I have a point feature class that has a SHAPE number of 9291884.  Can I go straight to that somehow?
Alternatively, I can see the 'image' binary data stored in the points column in the database table, can I read that in and just cast it to an IPoint?  Is that possible?


texts: Arcpy publish failing staging after analysis passed

texts:
I have code (that has been working) to publish a map document.  What's happening today (never seen before), is that the analysis (AnalyzeForSD()) is working without error, but I staging (StageService) is failing with 'Error 001272: Analyzer errors were encountered (codes=1,2)'.

So, several odd things happening there.  First, I looked up those codes, and those indicate that 1) no data is present in the data frame, and 2) no spatial reference is set.  AnalyzeForSD() should indicate either of those errors (I have seen both before from that).

Second, I did check the DataFrame (and there is only one of those), and did find all the layers I expected there.  Third, I also verified that all those layers were connected to a valid data source (via ListBrokenDataSources()).  Fourth, after the script finishes, I can re-open the MXD in ArcMap Desktop, and see everything there. (And the script and ArcMap are both being run as the same user, which should (I think) eliminate the possibility of a permissions issue.)

Finally, I can publish from that MXD within ArcMap.

Anyone have any ideas what I can try?


texts: Semi-Automatic Classification Plugin error

texts:
I recently installed QGIS 3.18 in my Windows system. But when I installed "Semi-Automatic Classification Plugin", this error occured:

Semi-Automatic Classification Plugin: Error. Check Python Matplotlib
installation for the Semi-Automatic Classification Plugin.

Can you give me some ideas about what may cause this?


texts: How to add a constraint in a google geocoding API request

texts:
I'm trying to get the center point of some localities using the geocoding API from google.

95% of the requests get the expected result but from time to time the API give me an unexpected result because the name of my locality is also the name of a natural feature. In thoses cases the coordinates indicate the natural feature and not the locality.

So for example I have this request:

https://maps.googleapis.com/maps/api/geocode/json?address=Le Gibloux+FR+Switzerland&MY_API_KEY

Which give me this result

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Le Gibloux",
               "short_name" : "Le Gibloux",
               "types" : [ "establishment", "natural_feature" ]
            },
            {
               "long_name" : "Sorens",
               "short_name" : "Sorens",
               "types" : [ "locality", "political" ]
            },... and so on
          ],
         "formatted_address" : "Le Gibloux, 1642 Sorens, Suisse",
         "geometry" : {
            "location" : {
               "lat" : 46.68413690000001,
               "lng" : 7.0403161
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 46.69179099999999,
                  "lng" : 7.0563235
               },
               "southwest" : {
                  "lat" : 46.6764818,
                  "lng" : 7.0243087
               }
            }
         }

I would like to constraint the request to get only features with a type "locality, political".

I try to add some &types=locality, or &address_components=locality,... in the request but unfortunatly, I always get the natural feature first.

Did you know how to set a constraint with this API ?


texts: OpenLayers.Layer.MapServer not rendering but new OpenLayers.Layer.WMS does

texts:
I got the following code:

var layern2 = new OpenLayers.Layer.MapServer("Tech",
                "ServerPathTo_mapserv.exe",
                {
                    map: "ServerPathTo_My.map"
                },
                {
                    isBaseLayer: false,
                    layer: "Layer1",
                    version: "1.1.1",
                    transparent: "true",
                    visibility: true
                });

That does not render a non transparent layer without images (all titles are rendered with a missing image icon on the upper left corner)...

But the following Code does render everything in the correct way:

var layern2 = new OpenLayers.Layer.WMS("Tech",
                  "ServerPathTo_mapserv.exe?map=ServerPathTo_My.map&REQUEST=getmap&VERSION=1.1.1&LAYERS=Layer1&FORMAT=PNG", { layers: 'Layer1', TRANSPARENT: 'TRUE' });

Does anyone know what I'm doing wrong?


texts: Why can't the breakpoint be "hit" when debugging an ArcGIS 10 Add-In?

texts:
Now and then I run into the following problem:

I start debugging the Add-In and breakpoints are ignored. Almost seems like the communication between the IDE and the component is not working.

My problem is that the last time this had happened I resolved it and now I can't remember what I did to fix it.

The breakpoint will not currently be hit. No symbols have been loaded for the document.

Partly, the issue I am having is already described here but there is no solution for the actual breakpoint malfunction.

Please note that this normally works.

Deleting the bin and the obj does not seem to work.

This time I just restored my entire project from backup and started over but I would like to know how to fix this should I come across this again.


texts: Vector map - Multiple local sources with Mapbox-GL

texts:
I'm building a web map using Mapbox-GL (renderer) and OSM2Vectortiles (vector map tiles).

Since the OpenStreetMap's data are insufficient in my country, I've used QGIS and Satelite images to add some roads, POIs,... and converted to vector tiles (PBF files).
It's quite difficult and time-consuming to merge my data with OSM, and then convert the whole complex things again.
I know that Mapbox support multiple sources, but I only found examples where the sources coming from Mapbox. I'd like to serve the tiles without Mapbox's cloud services.

Is it possible to use multiple sources (OSM2Vectortiles + My rendered tiles) with Mapbox-GL-js?


texts:
I have been messing around with the SqlGeometry in the Microsoft.SqlServer.Types namespace in .NET, and have been rather impressed.

Can anyone provide me with an example of how I could clip a geometry by another geometry?  I know there are other libraries (ex. NetTopologySuite) that do this type of stuff in .NET, but I am trying to do this without any additional dependencies.


texts:
I installed both otb-bin and otb-python using OSGeo4W.

In OSGeo4W Shell, I have no problem importing otbApplication.

But I have a problem doing this in Python Shell. The error message is as below:

>>> import otbApplication
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import otbApplication
ImportError: No module named otbApplication

I guess I have to configure some environmental variables, but I have no idea.

My OS is Windows 7 and the Python version is 2.7.


texts: QGIS Feature Selection - Add to Current Selection

texts: I have recently started working in QGIS. I need to select multiple features loaded in map canvas one by one. To select a feature in addition to the selected features in the map canvas, I need to hold the 'CTRL' key. Is there settings options available in QGIS so that I can configure the 'Add to current selection' without holding the 'CTRL' key?


texts:
I want to to use a very good looking colormap/color ramp from a MATLAB program LINK in QGIS 3.x.
I already tried to save a colorramp from QGIS and insert the values from the MATLAB colormap after multiplying the values with 255 and rounding the values (do I even need to round?).
the resulting 4 columns look like this:
QGIS Generated Color Map Export File

INTERPOLATION:INTERPOLATED
0,255,255,255,255
1,24,136,55,255
2,28,140,56,255
3,32,144,57,255
4,36,148,58,255
5,40,152,59,255
6,43,155,60,255
7,47,158,62,255
.
.
.
.
.
.
.

However I get a generic error message:
Can someone point me in the right direction or has a working solution?


texts:
I have a DEM and velocity matrices of several transects.
Is it possible to import the matrix (or 2D plot of the matrix, heatmap) to QGIS ?


texts:
I am still a novice in python, but I have the long term goal to create a plugin one day. The first step to this plugin is a test with QGIS python scripts to convert an Access mdb into sqlite db and then to proceed from there.

I found a python script here that will dump an Access mdb into a sqlite db.

The script is normally called from commandline with this patter: python AccessDump.py access.mdb | sqlite3 new.db

I now try to change the script, so i can run it as a QGIS script from the Processing Toolbox, but I really lack the basics so far.

Original script:

#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
#   http://sourceforge.net/projects/mdbtools/

import sys, subprocess, os

DATABASE = sys.argv[1]

# Dump the schema for the DB
subprocess.call(["mdb-schema", DATABASE, "mysql"])

# Get the list of table names with "mdb-tables"
table_names = subprocess.Popen(["mdb-tables", "-1", DATABASE],
                               stdout=subprocess.PIPE).communicate()[0]
tables = table_names.splitlines()

print "BEGIN;" # start a transaction, speeds things up when importing
sys.stdout.flush()

# Dump each table as a CSV file using "mdb-export",
# converting " " in table names to "_" for the CSV filenames.
for table in tables:
    if table != '':
        subprocess.call(["mdb-export", "-I", "mysql", DATABASE, table])

print "COMMIT;" # end the transaction
sys.stdout.flush()

I already understood the basic mechanism to first read out the table schema of the .mdb for each table, and then export tables content into the newly created db. However, I have no clue how to change the script so that I do not need that | sqlite3 new.db - part from the original shell command, but integrate it into the script, respectivly change new.db to be the output variable from the script dialog.

##Database=group
##Access.mdb to SqLite=name
##inputmdb= input file
##outputsqlite = output file


texts: Homebrew OGR with FGDB support on OSX 10.9

texts:
This answer worked beautifully in 10.8, but isn't working immediately in 10.9.

The link to download the FileGDB API still works, but there are a bunch of options available I don't remember from before. Do we want the Mac version, or the Linux one? Version 1.2 or 1.3?

I've tried the Mac version 1.3 so far.


texts: Determining acceptable RMSE for Orthorectification?

texts:
I have been reading about orthorectification and did some training on it but my question still remain unclear is how much RMSE should I aim to ?

I will be working on a lot of aerial photos that dated back from 1930's to 1950's. I will use ERDAS' Autosync to orthorectify aerial photos.

The training I had said to keep the RMSE lower as possible but it did not explain why or for any reason to keep them lower. It didn't say which imagery to use. It didnt tell why which referenced image had a better RMSE to work with.


texts:
i want to create a python scipt query using arpy in arcgis
i have one polyline shapefile and one polygon shapefile i want to choose(select) the polygons where contained within in the polylines shapefiles or there intersections and finaly i want that select polygons to export to new shapefile layer.
i use arcmap 10.1

my code is

# Import arcpy module
import arcpy
from arcpy.sa import *

arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput = True
try:
arcpy.env.workspace = root
root = arcpy.GetParameterAsText(0)
polygon = arcpy.GetParameterAsText(1)
line =  arcpy.GetParameterAsText(2)
except:
arcpy.AddMessage(arcpy.GetMessages())
try:
arcpy.SelectLayerByLocation_management(polygon, "INTERSECT", line, "", "NEW_SELECTION")
arcpy.FeatureClassToShapefile_conversion("polygon", newpolygon)
newpolygon = root + "\\newpolygon"
except:
arcpy.AddMessage(arcpy.GetMessages())

i use that code but i dont take Correct Results my root workspace is empty

any idea ?


texts:
I would like to create a map in QGIS comparing the relative size and latitudes of Japan to the US. There are a few websites like mapfrappe which allow this using Google Maps, but I would like to be able to have more control over the map settings, projections etc. I like the idea of country comparisons, but I really don't like their execution. My goal is to give a frame of reference for possibly unfamiliar locations. If I discuss Hokkaido, it might be hard to visualize how far north it is, or how large it is. I could provide coordinates and area measurements, but if a large number of areas are discussed, people can start to drown in numbers, where a map or image can quickly provide easy to compare references.

I created an example using the Natural Earth coastline shapefile as a base and dragging the DIV GIS japan admin shapefile over to the east coast of the US (super crappy, but provides a quick visualization). I am not worried about area distortions because I don't want to change any latitude values, but I do want the latitude coordinates to be accurate.

What would be a better way to go about this in QGIS?


texts: Preserve Nulls Environment Setting with Append in Arcpy - warning 000596

texts:
I'm appending data in my script and some of the source data has nulls in fields that are required. The script runs successfully but those features do not get appended.

When I run the tool in ArcMap, I get

  warning 000596 - "This warning will occur when attempting to add a
  value to a field that is inappropriate for that value. For instance a
  text with a width of 10 cannot be merged into a field that has a width
  of 5... This warning will also result from adding a null value to a
  field that does not support null values."

The offered solution is

  "When dealing with nulls, the Preserve Nulls environment can be turned
  on or off to control whether nulls are preserved in the output. If
  turned off, the tool used will attempt to add null values to a field
  or format that will not accept them."

I cannot find the Preserve Nulls environment setting.

This is the link to the warning: http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00576-00600-000596.htm

I am on version 10.3.1

The reason I want to preserve the nulls (and keep the field non-nullable) is that this data will be edited in Collector and I want the user to be forced to correct the error when they edit that feature. The alternative I may pursue is to put a value in the fields that is outside of the domain, which will also force the user to correct the data in Collector, however I'm short on time and there are a lot of fields I will need to do this for. That is why the Preserve Nulls setting appealed to me.


texts: Buffering with dissolve type: ALL for a big feature class doesnot create a single multipart feature

texts:
I am using buffer tool on large complicated network (260,000 features) line shapefile to create an area shapefile. This area shapefile somehow has to be dissolved to a single multipart shapefile.

Code used:

arcpy.Buffer_analysis(featureLayer , temp2, "0.5 Feet", "FULL", "FLAT", "ALL")
arcpy.Dissolve_management(temp2, temp3, "", "", "", "")
arcpy.MultipartToSinglepart_management(temp3, outputLayer)

Problem:
The dissolve after buffer for some reason does not create a single multipart feature. It creates many multipart features that can't be dissolved with each other. I tried to dissolve it five consecutive times, it produced the same result.

Is there any way to dissolve all these features to create a single multipart feature?


texts: Adding feature class to map (within specific group) using ArcPy with ArcGIS Pro?

texts:
I am trying to add a feature class to my ArcGIS Pro map (a specific group), but I don't seem to be able to find the way.

This is the piece of code I've written:

import arcpy
arcpy.env.workspace = r'D:\ArcGIS_Pro_Projects\Optimity_Alf'
fc_output = r'D:\ArcGIS_Pro_Projects\Optimity_Alf\Optimity_Temp.gdb\LOS_Optimity_All_700m'
fl_output = 'LOS_Optimity_All_700m'
arcpy.MakeFeatureLayer_management(fc_output, fl_output)
aprx = arcpy.mp.ArcGISProject(r'D:\ArcGIS_Pro_Projects\Optimity_Alf\Optimity_Alf.aprx'
m = aprx.listMaps('MyMap')[0]
m.addLayerToGroup('LOS Results', fl_output)

Where 'LOS Results' is the group.

I get the following error:
    ValueError: LOS Results
    Failed to execute (Testing).

Anyone has any idea?

Following @Hornbydd's advice I have run the following code:

import arcpy

arcpy.env.workspace = r'D:\ArcGIS_Pro_Projects\Optimity_Alf'

fc_output = r'D:\ArcGIS_Pro_Projects\Optimity_Alf\Optimity_Temp.gdb\LOS_Optimity_All_700m'
fl_output = 'LOS_Optimity_All_700m'
arcpy.MakeFeatureLayer_management(fc_output, fl_output)

layer = r'D:\ArcGIS_Pro_Projects\Optimity_Alf\Temp\LOS_Optimity_All_700m.lyrx'
arcpy.SaveToLayerFile_management(fl_output, layer, 'ABSOLUTE')

lf = arcpy.mp.LayerFile(layer) # This is pointing to LOS_Optimity_All_700m
aprx = arcpy.mp.ArcGISProject(r'D:\ArcGIS_Pro_Projects\Optimity_Alf\Optimity_Alf.aprx')
m = aprx.listMaps('Optimity Map')[0]
refLyr = m.listLayers('LOS Results')[0]
m.addLayerToGroup(refLyr,lf)

It doesn't throw any errors but it doesn't add any layer to my map.

Also, is this the only way to do such a simple thing as adding a layer to a map?
I have a feature class in a geodatabase with the data I'd like to plot and I have had to convert that feature class into a feature layer and then that feature layer into a layer file so that it can be displayed. Doesn't it seem over complicated?


texts: How do I use filters on multiple layers in Kartograph?

texts:
I am trying to create a map of the continental US and Puerto Rico using Kartograph. I am using the shapefiles from Natural Earth, and I obtained the filter keys from the column headers of the DBF files for each data set. My intuition tells me to first add only Puerto Rico from ne_50m_admin_0_countries_lakes.shp, and then add the Continental US states from ne_50m_admin_1_states_provinces_lakes.shp. My config.json file is as follows:

{
    "layers": {
        "world": {
            "src": "ne_50m_admin_0_countries_lakes/ne_50m_admin_0_countries_lakes.shp",
            "filter": ["gu_a3", "is", "PRI"]
        },
        "states": {
            "src": "ne_50m_admin_1_states_provinces_lakes/ne_50m_admin_1_states_provinces_lakes.shp",
            "filter": {
                "and": [
                    ["sr_adm0_a3", "is", "USA"],
                    ["postal", "is not", "AK"],
                    ["postal", "is not", "HI"]
                ]
            }
        }
    }
}

But when I run kartograph:

$ kartograph config.json -o config.svg

I end up with a map of only Puerto Rico:

If I reverse the order of the layers in the JSON, I get a map of the Continental US but not Puerto Rico:

How do I prevent the filters on the first layer from cropping out everything on the second layer?


texts: Point dataset from CSV showing up outside of known region

texts:
I'm using QGIS and trying to display point data from a CSV file.  I've added a vector layer with a shapefile of Canada.  Both the project CRS and the shapefile CRS are set to NAD83 / Statistics Canada Lambert.

The CSV file CRS is also set to NAD83 / Statistics Canada Lambert.

The points should appear somewhere in the province of Manitoba.  However, the points show up outside of the map.

As shown by the attribute table, the lat / long appears normal, but the points show up at the wrong location.

What I am doing wrong here?  I've tried to ensure that both CRS projections are the same.  I've also tried switching the x and y in the CSV import, but the points still continue to show up at the same location.

Here is the CSV file data:

-98.43936109999999,49.3958333,TCR1
-98.38749999999999,49.3505556,TCR2
-98.38666669999999,49.3630556,TCR3
-98.3791667,49.3277778,TCR4
-98.3697222,49.39777779999999,TCR5
-98.3605556,49.3361111,TCR6
-98.3363889,49.3902778,TCR7
-98.33138889999998,49.3844444,TCR8


texts: Get the ID of polygon in edition sessions of QGIS?

texts:
I did a Qt custom form for QGIS which contain a QlineEdit that must get the ID of the current polygon in edit session.

For example, I start edit sessions I draw 3 polygons when the Qt form is opened the QLineEdit is empty so only when I save modification and then when I click on my polygons I get the ID.

PS: I tried signals of QGIS but that doesn't work on QGIS 1.8.
Could someone help me please !!


texts: How to get the geohash of a bounding box?

texts:
I am storing a large collection of 5m x 5m geohash values. I want to be able to query this collection and find all the geohash values which fall within a particular georect - which is defined by a 2 latitude points - a NW point and a SW point.

What I don't understand is this: lets say I have all my locations in the data store (along with a latitude, longitude and a geohash (with high precision) of each location.)

I know that I should use the prefix of the geohash (to match locations within), but how do I calculate a geohash of a bounding box? Considering the bounding box is made up of two points, North-East and South-West, I do not understand how to go about doing this..

In order for me to query which locations should be returned for the currently visible bounding box, I need the geohash of the visible/viewable bounding box - Now I know I can geohash the center location on the viewable map, but I do not know how many letters to cut off (to reduce precision) to achieve 'a fit' to the actual bounding box. (Or maybe that isn't the way...?)

What do you do when the bounding box container to geohashes? (like in the middle of the viewable area it splits between 'dqcjr0' and 'dqcjqb')

Also, lets assume I have a 5 letter geohash, how can I convert that back into a viewable bounding box? or in other words, how do I know what is 'included' in the hash, and what is in adjacent hashes?


texts: Correct syntax for search query restrictions in arcpy.CalculateLocations_na?

texts:
In ArcMap, I have created a tool using Model Builder that has a Calculate Locations (Network Analyst) step. This step includes a Search Query to restrict Routing_Streets to features that are not CONTROLLED_ACCESS and not FERRY. It works perfectly when I run it from the model, but not when I export it to python script and run it in IDLE.
This is the script that the Model Builder exports:
arcpy.CalculateLocations_na(MyInputFeaturesFC, Routing_ND, "100 Feet", "Routing_Streets SHAPE;Routing_Streets_Override NONE;Routing_ND_Junctions NONE", "PRIORITY", "SourceID", "SourceOID", "PosAlong", "SideOfEdge", "SnapX", "SnapY", "Distance", "", "", "INCLUDE", "Routing_Streets 'CONTROLLED_ACCESS ='N' AND FERRY='N'';Routing_Streets_Override #;Routing_ND_Junctions #")

In IDLE the Check Module finds no problems, but when I Run Module I get this error:
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\na.py", line 468, in CalculateLocations
raise e
RuntimeError: Object: Error in executing tool

After trial and error, I have determined that the error goes away if I remove the 'CONTROLLED_ACCESS ='N' AND FERRY='N'' and replace it with #, therefore I believe that the syntax is incorrect, but I've tried all different combinations of quotes, escaping quotes, and other syntax that I can think of.


texts: Adjust appearance of text table in printed layout with PyQGIS

texts:
How do I adjust text size and border width of QgsLayoutItemTextTable in QgsLayout? I would like to have text smaller and borders thinner.
Here is my code which adds the table to layout.
composition = QgsLayout(QgsProject.instance())
table = QgsLayoutItemTextTable(composition)
composition.addMultiFrame(table)

# Add columns abd fill with data
fields = ['Field1', 'Field2', 'Field3']
cols = [QgsLayoutTableColumn(), QgsLayoutTableColumn(), QgsLayoutTableColumn()]
for n in range(0, len(fields)):
    cols[n].setHeading(fields[n])
table.setColumns(cols)
table.setContents(data)

# Add frame
frame = QgsLayoutFrame(composition, table)
frame.attemptResize(QgsLayoutSize(20, 500), True)
frame.attemptMove(QgsLayoutPoint(10, 470, QgsUnitTypes.LayoutMillimeters))
table.addFrame(frame)


texts: Rearranging labels in screen to avoid overlapping

texts:
I have a map, with some icon over it. Every icon has a label next to it. When icons overlaps, labels are overlapped too. In this case, I want to move labels so they don't overlap anymore, with a line linking them with respective icons. Obviously I know size and position of labels and icon, related to screen coordinates.

Which algorithm should I study in order to implement this (I can't use any GIS library)? I've searched for declutter on Internet (I don't speak English very well), but I've found only ideas for hiding/showing icons, not for label moving.


texts: Calculate slope of line based off of point layer

texts: I have a line feature class that needs to have its slope included as a field.  I have a point layer that contains points and their elevations for the start and end of the line segments.  How can I calculate the slope of the line feature class using my point layer?  I am open to Python, QGIS, & ArcMap solutions.


texts: Connect QGIS to MSSQL view (i.e. not a table)

texts:
I've got a MSSQL view containing data I want to show in QGIS. The view transforms a BLOB field  containing WKB that is in one of my tables into a SQL geometry, which QGIS will be able to display.

When I connect to a MSSQL source from in QGIS the views aren't showing up. Is there an easy way to get them appearing?

Btw, I'm running QGIS 1.8.0-Lisboa on Windows 7.

Thanks for any help you can offer. Steve


texts:
I try to implement a custom node tag resolver to make a railway stations exported with specific clazz value.

I used this article How to extend OSM2PO with ferry durations? as manual.

Class compiled and jar for new tag resolver created successfully.

But when I run an export with command:

java -Xmx2g -jar osm2po-core-5.1.0-signed.jar -classpath osm2po-core-5.1.0-signed.jar:osm2po-plugins/osm2po-plugins-5.1.0_custom.jar:de.cm.osm2po.Main cmd=c /PATH-TO-OSM-FILE

The result is unsupported major,minor version 51.0.

As I understand, osm2po-core-5.1.0.-signed.jar compiled with 1.7.0_55-b13 and I had generate a osm2po-plugins-5.1.0_custom.jar with 1.7 version as well.

Is anyone had same problem?

folder structure:

osm2po-5.1.0/
   osm2po-doc/
   osm2po-plugins/
      de/
          cm/
             osm2po/
                demos/
                   ...
                samples/
                   MyNodeTagResolver.java
          de/
             cm/
                osm2po/
                   samples/
                      MyNodeTagResolver.class
      osm2po-plugins-5.1.0_custom.jar
      osm2po-plugins-5.1.0.jar
      osm2po-demos-5.1.0.jar
      demos.txt
   osm2po-web/
   osm2po.config
   osm2po-core-5.1.0-signed.jar


texts: MODIS Imagery Orthorectification (Open Source)

texts:
I am looking for an open source free software/tool for orthorectification/Geometric terrain correction of MODIS imagery.

I have looked at ESA (European Space Agency) SNAP but this sensor type is not supported only SAR.  I have also looked at the OTB (ORFEO Toolbox by the French Space Agency) through QGIS but it also seems there are limited sensors.

How to address terrain relief correction for MODIS imagery through open source platforms?


texts: Problem with the where clause in ArcGIS when dealing with variables

texts:
I am writing a python script for ArcGIS.  I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline.  I would like to iterate through the pipelines and run some run some processes on them individually.

The script is set up to prompt the user to choose the field which contains a unique identifier for each pipeline.  I am saving this field as a variable called PipelineIDField.

I run a search cursor to get the actual pipe name in that field and I'm saving that as fullRouteName.

I'm using:

arcpy.MakeFeatureLayer_management(InputPipeline, 'SelectedPipe', where_clause)

and the where clause is defined as:

where_clause=""""%s" =""" %PipelineIDField + """ '%s' """ %fullRouteName

I would assume that I could then successfully use 'SelectedPipe' to run my processes on the individual pipe.

This is successfully working when I run the where clause in the python window within ArcGIS, however, it doesn't select out the individual pipes in my script.  The where clauses are identical.

I have tried using escape characters "\"" and "\'" with the same result.

Any idea what is going on here?

I'm using ArcGIS 10.1 service pack 1 on Windows 7 64-bit.

Thanks.


texts: How to programmatically detect a canvas refresh or pan/zoom in QGIS

texts:
For my python plugin I would like to remove a VertexMarker when the user pans/zooms there map.

Which is the best way to detect a canvas refresh or pan/zoom carried out by the user?

Can you suggest any plugins which have this functionality I can take a look at?

Thanks


texts: QGIS Set Composer Legend to shrink the font size to fit

texts:
QGIS 2.10.1. I have read that it is "impossible to make the legend smaller then its contents".

Is there a way to set the legend to shrink the font size when re-sizing the bounding box? Or when you add a new item to the legend? From my reading of answers to related questions I suspect not. (I am not a Python coder.)


texts: Displaying measurement of current segment in Measurement Widget of ArcGIS API for JavaScript?

texts:
In this ESRI measurement widget sample:
https://developers.arcgis.com/javascript/jssamples/widget_measurement.html
when you draw a line, it dynamically displays the segment length. And, when you measure subsequent segments lengths, it add it to the previous length.

How can I add another result which dynamically shows the current segment length?


texts: Need to extract rectangle coordinates from a shapefile

texts: New R user. I'm trying to create an observation window for a point pattern in R using a shapefile imported from ArcGIS. I've imported the shapefile and it is recognized by R as a feature class type:polygon. I need the xmin, xmax, ymin, ymax of the extent and that is all in order to specify these in creating the owin object. I can't seem to extract these values from the polygon. I know this is very basic but I can't put 2 and 2 together here.


texts: ProjNet Nad 27 to WGS 1984 Results Incorrect

texts:
I'm fairly new to the ProjNet library and GIS in general so please bare with me.

I have a set of coordinates from a EPSG:32038 system and I'm trying to convert to decimal Latitude and Longitude (WGS 1984). The result from ProjNet is about 700 feet south of the supposed location.

Input coordinates:

x = 1979302.949; y = 437337.980;

WKT used to define EPSG: 32038

PROJCS["NAD27 / Texas North Central",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982138982]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",32.13333333333333],PARAMETER["standard_parallel_2",33.96666666666667],PARAMETER["latitude_of_origin",31.66666666666667],PARAMETER["central_meridian",-97.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["Foot_US",0.30480060960121924]]

The result from ProjNet are:

latitude    32.866837297179472
longitude   -97.56741127050887

I cross checked with NOAA's SPC to GEODETIC online tool and the results converted from DMS to decimal Lat Long are:

latitude    32.86879
longitude   -97.567574

The result from NOAA is a lot closer than what I'm getting from ProjNet. The WKT is copied from Spatial Reference website and cross checked with ESPG website. At this point, I'm not sure if the WKT used is incorrect or an issue in ProjNet.


texts:
I read and I read opinions and topics regarding this tool but I am still unclear if I should us this or not.

In my project I have thousands off tiff files which need to be put on a map. The problem is that while creating the tiles (map tiles) it runs really slow, especially when it needs to put a lot of tiffs on a tile..

I heard that gdaladdo can speed this up but I am unsure if this could affect the quality of the tiff files and/or any other side effects.

Unfortunately, I do not have a backup for the files and while I was testing this on a few bunch of files, the only thing I saw was the increase in size for each of the files.

If anyone had positive (and especially negative) experiences using this tool, I would appreciate an example, advice or anything you think can help.

Many thanks,


texts: Creating perpendicular polylines of specified length that retain attributes of original polylines using ArcObjects and VBA?

texts:
I am using ArcGIS 9.2 and am desperately trying to create perpendicular polylines to existing polylines that I have.  I would want the perpendicular lines to cross the original lines at their midpoint and I want the perpendicular lines to maintain the attributes of the original lines and finally I'd like to be able to control how long I want the perpendicular lines to be (eg. 50 metres)

A script I found and which I've pasted below, takes me a good part of the way there in that it creates perpendicular lines at the midpoints but it doesn't retain the attributes or allow me to set the length.  Can anyone suggest what I need to change to bring over the attributes and let me set the length of lines that are drawn.

    Option Explicit
Sub Test()
    Dim pEditor As IEditor
    Set pEditor = Application.FindExtensionByName("ESRI Object Editor")
    If pEditor.EditState <> esriStateEditing Then
        MsgBox "start editing first"
        Exit Sub
    End If

Dim pEL As IEditLayers
Set pEL = pEditor
If pEL.CurrentLayer.FeatureClass.ShapeType <> esriGeometryPolyline Then
    MsgBox "target layer must be polyline"
    Exit Sub
End If

If pEditor.Map.SelectionCount = 0 Then
    MsgBox "nothing selected"
    Exit Sub
End If

Dim pEnumFeat As IEnumFeature
Set pEnumFeat = pEditor.Map.FeatureSelection
pEnumFeat.Reset
pEditor.StartOperation
Dim pFeat As IFeature
Set pFeat = pEnumFeat.Next
Do Until pFeat Is Nothing
    If pFeat.Shape.GeometryType = esriGeometryPolyline Then
        Dim pNewFeat As IFeature
        Set pNewFeat = pEL.CurrentLayer.FeatureClass.CreateFeature
        Set pNewFeat.Shape = MakePerp(pFeat.Shape, _
                                      GetLength(pFeat.Shape))
        pNewFeat.Store
    End If
    Set pFeat = pEnumFeat.Next
Loop
pEditor.StopOperation "makeperps"
Dim pAV As IActiveView
Set pAV = pEditor.Map
pAV.Refresh
End Sub

Function GetLength(pPolyline As IPolyline) As Double
    GetLength = pPolyline.Length
End Function

Function MakePerp(pBaseLine As IPolyline, ByVal dLen As Double) As IPolyline

Dim pPointColl As IPointCollection
Set pPointColl = New Polyline
Dim pPerpLine As ILine
Set pPerpLine = New Line

pBaseLine.QueryNormal esriNoExtension, 0.5, True, dLen / 2#, pPerpLine
pPointColl.AddPoint pPerpLine.ToPoint
pBaseLine.QueryNormal esriNoExtension, 0.5, True, dLen / -2#, pPerpLine
pPointColl.AddPoint pPerpLine.ToPoint
Set MakePerp = pPointColl
End Function


texts: I want to draw a single circle which includes all points in a layer, but is as small as possible (so the two outermost points are exactly at the line). Is there any way to do this in QGIS (3.4) or with a QGIS plugin?


texts: Parameter names and meaning of their values in an ENVI header file

texts:
This is the header of an Envi file:

ENVI
description = {
PolSARpro File Imported to ENVI}
samples = 8407
lines   = 5569
bands   = 1
header offset = 0
file type = ENVI Standard
data type = 4
interleave = bsq
sensor type = UAVSAR
byte order = 0
map info = {Geographic Lat/Lon, 1, 1, -98.600943, 49.98488736, 0.000055560, 0.000055560, WGS-84}
band names = {
T11.bin }

I can understand the meaning of most of the parameters in this header but about the map_info field:

map info = {Geographic Lat/Lon, 1, 1, -98.600943, 49.98488736, 0.000055560, 0.000055560, WGS-84}

What are 1,1,0.000055560,0.000055560?


texts:
I have a layer that represents a road network. The lines for the roads don't always meet, but I want them to.

I want to make the pink lines join to the nearest segment of the blue line. I followed the instructions to clean and snap in GRASS, but I get this result:

I don't want the small angles that are created where the blue line is distorted. I would like to make the pink line extend to meet the blue line.

Can anyone help?


texts: Understanding the spacial reference/How to get latitude and longitude from a .las LiDAR file

texts:
I have downloaded some .las files from a LiDAR project listed on the USGS website. I am hoping to process them in Python. I was able to get the set of X,Y, and Z points using the following snippit in the documentation.
import laspy as lp
import numpy as np

las_file = r'lidar.las'
inFile = lp.file.File(las_file)

dataset = np.vstack([inFile.X, inFile.Y, inFile.Z]).transpose() #X, Y, Z data

The problem I was running into is that I didn't understand how to get a subset of the data using Latitude and Longitude coordinates. I have explored the data in the header and I see that the data is scaled by scaling factors but I still was confused how to scale this to a coordinate system that I would expect to see on a map.
>>>inFile.header.min
[504110.62, 4828500.0, 2728.0]
>>>inFile.header.max
[505499.99, 4829999.99, 3142.9900000000002]
>>>inFile.header.scale
[0.01, 0.01, 0.001]

I looked at the information sheet that was also downloaded with the .las file and it included the following information. I think this is trying to tell me how to convert the X,Y,Z data to Latitude,Longitude, and elevation but I didn't understand how to make this transformation in python.

Is there a package or library or custom function that I can implement that can assist me to make the conversion to latitude and longitude coordinates so that I will be able to select points from this LiDAR point cloud that are inside of a polygon defined as a series of latitude/longitude points?


texts: Working around "Unable to allocate memory" error during for-loop in Arcpy

texts:
I'm running a very long for-loop in Arcpy (with ArcGIS 10.7 on Win10) over several ten thousand files. It runs smoothly until, everytime after about 3000 iterations (3-4h), it crashes with the error message "unable to allocate memory" and I have to restart it which is unnerving. (My code is too long to post here, I mainly project, clip, merge and copy shape- and rasterfiles and calculate some statistics.)
I have 16GB Ram and at no point are more than 8-9GB used, according to the Task Manager. I suspect that, if it is not just a bug, ArcGIS has some kind of internal memory that fills up with every iteration.
My question is therefore: Is there a command, a function or some way to work around this and keep the loop going?


texts: What is the best way to manage geodata with open source software?

texts:
We are a small group of GIS users with different expertises embedded in an administrative infrastructure attempting to switch to a small and low cost open source infrastructure (open source GDI). Currently we’re using ArcGis 10.1 and 10.2 for producing thematic maps for schools. The aim is to use QGIS for future work. To become independent from location as well as from the administrative data infrastructure we are looking for solutions to store our data. The data should be managed central and accessible for anyone in our group from home.
Until now we thought about an ftp server or a cloud solution. One key point is how to deal with simultaneous data access. For QGIS, are there any database server plugins that don’t require advanced database managing experiences?
We are interested in any experiences how to manage this switchover and especially which software is practical.


texts: Earth Engine Map view disappeared from Code Editor API. How can I bring it back?

texts:
This question is about the interface on Google Earth Engine. I have been using it for several days without problem, however just today the map view disappeared. I can still bring up a small inset in the console but it is very irritating not having the default view. It's not minimized, I can't adjust it at all. Attached is a picture of what I see now:

Circled in red is where the button for expanding the map view should be. But it is gone. How do I bring it back?


texts: GDAL Brightness RGB Contrast Gamma Saturation

texts:
I've not had much experience with modifying imagery, I've recently been playing with GDAL for some batch processing of geo-referenced images, I've been supplied with some imagery in ECW format that is rather dull and could do with some RGB, Contrast Gamma and Saturation adjustments.

Is it possible to adjust these values using GDAL or something similar?

I have managed to find the following values would most benefit my imagery.

Brightness -5
R 0
G +5
B -5
Contrast +75
Gamma +2.0
Saturation +190

This was found using irfanview which when used to batch process the imagery seems to strip the georeferenced inforamtion from it.


texts: Setting margins to maximise map area in QGIS

texts:
How does one know the margin size of a given printer?  I have designed maps in composer, changing size and position of map frame by trial and error.  Eventually I arrive at the biggest map I can produce on A4 that is not cropped, but if I then export to PDF then attempt to print that I either get the map drawn at a different scale if I 'fit to page', or the edges cropped if I don't.
Is there a similar feature to ArcGIS where the print extent for a given printer can be displayed in the composer?


texts: Concatenate Multiple String Fields and Convert to Date field using ArcGIS Field Calculator?

texts:
I'm Working in Model builder using the calculate value tool.  I have three columns - SignatureDay, SignatureMonth, SignatureYear - All three are string data types and all consist of just numbers for characters.  I can combine most values easily into a single field and then convert that field into a date.  My problem is that some values will not convert.

For instance:

SignatureDay   SignatureMonth    SignatureYear       Convert                SubmitDate
01                 05                 2014           20140105                1/5/2014
05                 05                 2014           20140505                5/5/2014
1                   5                 2014           201415

The code used to give me the values in the field

"Convert" = "{}{}{}".format(!SignatureYear!,!SignatureMonth!, !SignatureDay!)

for some reason the values with single digits and no zeroes in front, will not participate in the final output to a date type in the field "SubmitDate".

I've tried going through with the .replace() function but this table is dynamic and does not always have the same values.
So -

!SignatureDay!.replace('1', '01').replace('2', '02')

....etc   does not work, I would assume because all values 1-31(for every day possible) may not exist.  Also has to be a better way than repeating that 31 times.  I'm thinking there is an loop or something that could be run?

I'm a little lost on this one, my python experience is very limited as is my programming experience in general.


texts: setLayerDefinitions without defining layers?

texts:
I am working on a similar project to How to zoom to feature when clicking on drop-down list box item with ArcGIS JS API?, trying to filter the graphics on my map based on the user input into a FilteringSelect. The overall methodology of how my app is set up is that I go from a queryTask into a forEach loop that calls map.graphics.add(graphic) for each encountered feature returned from the queryTask.

I was hoping to be able to use the map.getLayer("dynamic").setLayerDefinitions(...) function to filter the map results based on user input, but from what I can tell that's not possible here since I don't define layers. Is there any way to accomplish this filtering with the setup I am currently using?


texts: Reprojecting XYZ coordinates in Python whilst keeping Z coordinate constant

texts:
When doing a reprojection from a projected coordinate system (e.g. EPSG:28992) to a geographic coordinate system (e.g. EPSG:4326), the Z coordinate gets an offset of 45 meters. The Z coordinates of both coordinate systems are in meters and have 0 set at mean sea level. So when reprojecting XYZ points with a height of 0 meters, you expect them to have a height of 0 meters after reprojection. This is not the case in Geopandas (which uses PyProj), PyProj and GDAL. How can one  reproject XYZ coordinates with Python whilst keeping Z coordinate constant?

import geopandas as gpd
from shapely.geometry import Point

geometry = [Point(192080.218800001, 326727.25, 0.0)]
crs = {'init': 'epsg:28992'}
pointRDnew = gpd.GeoDataFrame(index=[0], crs=crs, geometry=geometry)
pointWGS84 = pointRDnew.to_crs(epsg="4326")
print(pointWGS84.geometry[0])

POINT Z (5.914611042609124 50.92907898070797 45.24482111539692)

from pyproj import Proj, transform

x1, y1, z1 = 192080.218800001, 326727.25, 0.0
inProj = Proj(init='epsg:28992')
outProj = Proj(init='epsg:4326')
x2, y2, z2 = transform(inProj, outProj, x1, y1, z1)
print(x2, y2, z2)

5.914611042609124 50.92907898070797 45.24482111539692

from osgeo import ogr, osr

wktGeometry = 'POINT (192080.218800001 326727.25 0.0)'
epsgTransformation = epsgToWGS84Transformation(28992)
geometryFromWkt = ogr.CreateGeometryFromWkt(wktGeometry)
geometryFromWkt.Transform(epsgTransformation)
print(geometryFromWkt)

POINT (5.91461112637604 50.9290789739909 45.2474540863186)


texts: Turf difference function and coincident polygon boundaries

texts:
I've been wrestling with this issue for a few days.

The tool I'm creating takes one polygon and essentially minuses/subtracts another from it. A perfect use of the difference command in Turf.

The problems seem to arise when the polygons have the same boundaries for part of their areas. By boundaries I mean, imagine two polygons on top of each other, these are not polygons that border each other. One is on top and they have the same outline for part of their extents.

In the image, note the dark red outline of the polygon, a portion of which is being subtracted from the blue outline polygon (the blue polygon is on top, so along part of the coast the two polygons have the same outline).

Two polygons that intersect, but have no common boundaries are no problem, and I've done my best to ensure this is the case as much as possible. However unfortunately this isn't always possible.

What the difference command returns is the correct polygon minus the polygon subtracted, just what I wanted.

However it tends to include other small features that lie outside this polygon but along what was the common (think vertical here) boundary.

In the image showing after the function has run, note the small blue line (it's really a small polygon) along the coast directly north of the correctly processed polygon. It shouldn't matter, but as an FYI, the blue polygon is created by an earlier process, using a user created polygon that uses the intersect turf function, the intersect restricts the polygon creation to within the country boundaries.

It's as if the algorithm cannot cookie cut if it's too close to the edge of the dough (I am interested in, of course, the dough here outside the cookie cutter).

Be interested to hear if anyone else has had this issue and would have a workaround or post processing idea.


texts: QGIS - Create custom layer of polygons with eligible areas

texts:
I have two layers :

Regions, which shows the boundaries of different neighborhoods within a city (107 features in total).

Areas, which represent different polygons around this city that are considered as eligible areas for installation (around 20000).

I want to create a custom layer which visualizes those yellow areas within the regions, but also keeps those boundaries. So the result should look like the following more or less I guess.

So basically in the end I would like to have a layer that consists of 107 features again, each one representing a neighborhood, but the points that lie inside them and are not marked with yellow are "excluded". I don't think the Clip or Intersection function is what I want here, as its result doesn't keep the boundaries between those neighborhoods. If it helps, I aim to use this layer on a PHP/Leaflet application later which takes as input a neighborhood and returns some random points on the yellow points that are within.


texts: Is there a way to create multipart from singlepart features based on selected features only?

texts: QGIS has a tool for creating multipart features in the Geometry Tools section. However, this is applied to a whole layer, which leads to the yellow selection in the image below when used (selecting the pentagon selects the stripes as well). I only want to join the three stripes, though. Right now I'm accomplishing this by saving the parts I want to join as a new layer, executing the tool and merging them back to the source layer. However this is quite tedious and unproductive. Is there a better way?


texts:
I know that this question has been asked before, but not recently. Is there a way to have a web app that's private but only view-able to others through a link? Similar to the way an unlisted YouTube video works.

EDIT: As suggested in the comments, here is the link to the same question but asked a few years prior: ArcGIS Online: Sharing a private map

I am simply asking if there are any advancements in this area.


texts: Can't run a standalone QGIS application - ImportError: DLL load failed

texts:
I'm trying to learn how to create standalone QGIS app. I've gone through a few different errors, now I stuck at:
C:\OSGeo4W64>python3 testApp.py
Traceback (most recent call last):
File "testApp.py", line 1, in <module>
    from qgis.core import *
  File "C:\OSGeo4W64\apps\qgis\python\qgis\__init__.py", line 70, in <module>
    from qgis.PyQt import QtCore
  File "C:\OSGeo4W64\apps\qgis\python\qgis\PyQt\QtCore.py", line 24, in <module>
    from PyQt5.QtCore import *
ImportError: DLL load failed: The specified module could not be found.

App is very, very simple because it should only show an empty window:
from qgis.core import *
from qgis.gui import *
from PyQt5.QtCore import *
from PyQt5 import QtGui

app = QtGui.QApplication([])

QgsApplication.setPrefixPath("C:/OSGeo4W64/apps/qgis", True)
QgsApplication.initQgis()

window = QtGui.QMainWindow()
window_frame = QtGui.QFrame(window)
window.setCentralWidget(window_frame)
frame_layout = QtGui.QGridLayout(window_frame)

canvas = QgsMapCanvas()
frame_layout.addWidget(canvas)

window.show()
app.exec()

Here are environmental variables I use:
(I've tried a lot of different variables giving different errors, this set of variables gives an error written at the top of my post)
@echo off
call C:\OSGeo4W64\bin\o4w_env.bat
SET OSGEO4W_ROOT=C:\OSGeo4W64
set QGIS_PREFIX_PATH=C:\OSGeo4W64\apps\qgis
set GDAL_DATA=C:\OSGeo4W64\share\gdal\
set PATH=C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;%PATH%
SET PYTHONHOME=C:\OSGeo4W64\apps\Python37
set PYTHONPATH=C:\OSGeo4W64\apps\qgis\python;%PYTHONPATH%

cmd.exe

How to fix this problem?
(For a few days I was trying to solve other errors I encountered with this app by searching similar questions on the internet, but I get exhausted by it and finally decided to ask a question here...)


texts: File format (preferably open) for defining web service endpoints for ArcGIS Desktop?

texts:
Aside from .LYR files, is there a file format (preferably open) for defining web service endpoints for ArcGIS Desktop?

For example, if I publish a WMS feed, can I provide a downloadable resource for ArcGIS Desktop users?

Note endpoint is not ArcGIS Server - I'm looking for a simple method to allow ArcGIS Desktop users load OGC services for specific layers from a download.

What about .FDL?

It seems the .NMF (ArcGIS Explorer) formats can do the job. Are NMF files supported by ArcGIS Deskop 10?


texts: I know I can open my QGIS .dbf files in Excel (which converts them to .xlsx files). Can I then convert the edited file back into a .dbf file for use in my QGIS project? In other words, can I use the familiar functions, such as find & replace, in Excel, in order to edit my QGIS dbf files?


texts: Converting unknown coordinate (EPSG:3395?) to EPSG:3857

texts:
I'm attempting to convert a 7-digit coordinate of an unknown coordinate system I receive in this format:

{ lat: 4575651.267366762, lng: -9729851.06598594 }

After a few hours of trial and error, I found that a conversion from EPSG:3395 to my intended format EPSG:3857 yielded the best results, but are still unfortunately much too far north. The intended location of the coordinate above is a few meters from:

37°58'23.1"N 87°24'15.3"W

What is the coordinate system of the given 7-digit coordinate?


texts: Increasing number of presets for layers in QGIS?

texts:
Working with a map and make the schema the corresponding set of layers, save as a preset(very comfortable) but after 12 presets become unavailable menu to add preset.

Can you can then add the number of presets in QGIS?


texts:
I'm trying to load data from different tables using left outer joins into a QgsVectorLayer. The approach I'm following so far is the one from the developers cookbook here. The underlying database is postgres. The query returns correct data, including a geometry column, however I can't figure out how to get the join inside the query to work with QgsDataSourceUri.setDataSource(). As the table the data come from needs to be specified, is it even possible to do so?

Would approaching the problem using psycopg2 be more suited, and if so, is there a way to create a layer from the result set? The only way I can think of is creating an empty layer and adding each feature individually by looping over the result set. But possibly there is an easier way?

Sadly, using the builtin DB Manager is not an option. The layer has to be added programmatically.


texts:
I want to get the properties of a feature. How can I do that?
In the example below we can get one of the properties out like so feature.get('species'). How can we get all of them at once?
This is a failure feature.get('properties')

It works for geometry like feature.geometry() but not for properties.

// Make a feature and set some properties.
var feature = ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]))
  .set('genus', 'Sequoia').set('species', 'sempervirens');

// Get a property from the feature.
print(feature.get('species'));

print(feature.get('properties'));


texts: Removing coordinate system but not coordinates of raster?

texts:
I have several TIF files which has SWEREF99TM projection. What I want is to remove the SRS but keep the coordinates/extents of the file.

When I look at the file with gdalinfo:

Coordinate System is:
PROJCS["SWEREF99 TM",
    GEOGCS["SWEREF99",
        DATUM["SWEREF99",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6619"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4619"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",15],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","3006"]]
Origin = (650000.000000000000000,7602500.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  650000.000, 7602500.000) ( 18d40' 6.13"E, 68d29'41.24"N)
Lower Left  (  650000.000, 7600000.000) ( 18d39'53.05"E, 68d28'20.68"N)
Upper Right (  652500.000, 7602500.000) ( 18d43'45.66"E, 68d29'36.39"N)
Lower Right (  652500.000, 7600000.000) ( 18d43'32.36"E, 68d28'15.85"N)
Center      (  651250.000, 7601250.000) ( 18d41'49.30"E, 68d28'58.55"N)
Band 1 Block=1250x1 Type=Float64, ColorInterp=Gray
  NoData Value=0

When I strip the file from SRS I'd like it to look something like this in gdalinfo:

Coordinate System is `'
Origin = (367500.000000000000000,7010000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  367500.000, 7010000.000)
Lower Left  (  367500.000, 7007500.000)
Upper Right (  370000.000, 7010000.000)
Lower Right (  370000.000, 7007500.000)
Center      (  368750.000, 7008750.000)
Band 1 Block=1250x1 Type=Float64, ColorInterp=Gray
  Min=0.010 Max=310.480
  Minimum=0.010, Maximum=310.480, Mean=25.321, StdDev=73.974
  NoData Value=0

Can I do this preferably with GDAL?


texts: How to Polygonize a polyline shapefile in QGIS 2.2?

texts:
When I used QGIS 1.8, I was able to transform polyline layers to polygon layers with the Polygonizer plugin.  In QGIS 2.2, this function has been subsumed into the Processing toolbox.  Unfortunately, it doesn't seem to work.  I see that this problem has come up before (Making polygon from intersecting lines in QGIS using Polygonize or similar?) but hasn't been resolved.
Here's my polyline layer:

And here's what I get when I run the polygonizer function:

Only a fraction of the closed shapes have been successfully closed by the polygonize function.
Can anyone advise on how I might get this to work correctly?  As I said, I was able to do this sort of thing with the old Polygonizer plugin, using the slow/old methodology.  That doesn't seem to be implemented in the new function in QGIS 2.2.  Is there somewhere else I could find it?
Thanks in advance!
ETA: Running on Windows 7.  Installed via the standalone installer on the main QGIS webpage.
ETA2:  I installed QGIS 1.8 again and was able to produce this with the old Polygonizer plugin (with the output from the QGIS 2.2 processing function on top).  This was produced using the "Old method" in the Polygonizer plugin.  It took a long time but it worked much better.  The "New method" in the Polygonizer plugin produced the same polygons as QGIS 2.2.  So it appears that only the old plugin "New method" has been carried forward into QGIS 2.2?


texts: Shift a lat/lon coordinate based on a distance and direction?

texts: I have a coordinate in (lat/lon). I want to find a new coordinate shifted from this point by 'x' meters in the direction given by a compass bearing (degrees). The distance offset I am hoping to calculate will be fairly small, anywhere from 4-10 m, so I will need a fair amount of accuracy.


texts: I have a shapefile that I created of points on each structure and address in the city. We have been working in ArcMap Desktop for 6 or 7 years and depend heavily on being able to simply go to "find", type in the address then zoom to it. I have seen a "Zoom To Feature" plugin mentioned throughout QGIS Texts but I cannot find it using internet search. Does anyone know where I can find the "Quick Find" or "Zoom to Features" plugin?