texts: Considerations for projecting enterprise database to a new coordinate system

texts:
I currently maintain an enterprise geodatabase where the data is projected in a state plane coordinate system. Recently the data has extended past state boundaries. The data units are in feet and polylines do contain M values. I am concerned measures and GIS lengths(lengths are very important in the database) could become skewed as GIS data extends farther away from state boundaries.

In order to address this issue I am considering projecting the data into a new database using a non-state, regionally based coordinate system such as an UTM Zone.

My questions are following:

Would if be acceptable to just leave the data in state plane knowing measures are maintained?
Are there any issues with projecting from state plane into UTM Zone?(I have never done this for an SDE database)
Could English units to Metric Units be a concern?
Any suggestion or tips regarding this type of conversion?


texts: Creating boundary for multiple point shapefiles that overlay base polygon shapefile?

texts:
I have several point .shp files that were geocoded using OpenStreetMap. I located a base map to overlay the point files. I would like to create an artificial boundary based on an 80/20 rule for each point file. For example, the boundary would be drawn around 80% of the points and this process would follow for the rest of the point .shp files that have been geocoded. I searched through previous post and found Converting point sets to polygon boundaries?. This response represents what I would like to achieve. Therefore I attempted the procedures and fail short of the goal of obtaining arbitrary boundaries that would overlay. I have attached an image for a visual?

I am after any insight on how to create artificial boundaries based off an 80/20 rule.

I am new user to QGIS.


texts: I have huge number of x and y data . these are left longitude,right longitude,buttom latitude and up latitude. each row is an extent of a polygon.i'd like to create a polygon using these data without programming in ArcGIS. is there any tool to create polygon automatically?


texts:
I'm trying to calculate the area solar radiation for the Last Glacial Maximum using ArcGIS 10.3.

However, this seems not to be planned by Esri's Developers. Which option should I choose for the Time Configuration?

The calculation should be for one year. However, when I choose "Whole year with monthly interval", there appears an option to specify the year. I am not sure how to interpret this documentation text[1]: Does it play a role which year I'll enter there?
Furthermore, there is the option for "Special Days" which are then enumerated to be "Summer Solstice, Equinox, Winter Solstice".

This seems like a practical way to get the mean radiation values for one year. However, what exactly is done by the tool, using this option? Does it calculate means, does it build a sum....?

And at least: Is the calculation which this tool performs suitable to model the situation during the Last Glacial Maximum?


texts: Raster Iteration in Model Builder - Allowing a user to select the raster inputs

texts:
I have a basic model that uses Raster Iteration to process all of the rasters in a .gdb. The model allows the user to define a weighting in the GUI and then the model runs a raster calculation on each iteration, stores the results in Collect Values and finally does a Cell Statistics calculation ton create the final output.

As of now the Raster Iteration runs through all rasters in the .gdb. Is there a way of providing the user with a checkbox/radio button in the GUI to just choose a selection of the rasters in the .gdb?

The image below shows the model and the GUI. Ideally I'd like to be able to select the required rasters in the GUI before assigning the weightings.


texts: Improving execution time of Task.start()

texts:
I need to export lots of images from earthengine using the Python API. I use the following code.
Here everything is pretty fast but the execution of task.start() take ages.
satellites = {} #contain the names of the used satellites
    task_list = []
    for year in range(start_year, end_year + 1):
        image, satellites[year] = getImage(sources, bands, ee_multiPolygon, year)

        for i, polygon in enumerate(ee_polygons):

            description = f"{descriptions[year]}_{i}"

            task_config = {
                'image':image,
                'description': description,
                'scale': pm.getScale(satellites[year]),
                'region': ee.Geometry(polygon),
                'maxPixels': 10e12
            }

            task = ee.batch.Export.image.toDrive(**task_config)
            task.start() #this very step take ages
            task_list.append(description)

Is it normal ? and if yes is there a way to increase it's speed ? I don't really care about the time the images require to be downloaded to my Gdrive, my problem is that I want my end user to close the notebook when everything is launch on GEE. Unfortunately it this case it takes 30 minutes to start all of them.


texts: Split Vector Points/Polygons by Vector Grid and assign to relevant grid

texts:
I have 3 vector shapefiles (1: Point, 2: polygon, 3: vector grid) that I would like to combine so that the points and polygons are 'assigned' to the relevant grid cell within which they are contained, within a vector grid. I've attached a picture of what the vectors look like . Some of the polygons are across boundaries - I'd like them to be assigned to a single polygon (perhaps by which grid they are mostly located) as previously I have tried merge and they have been split. I am exporting this to KML to use in G/Earth Pro - previously I had the grid and then the points/polygons within a subfolder.

Is the last bit possible? It is likely a separate question.


texts: Using fixed vector layer parameter in QGIS?

texts:
How can I set my input layers to be called as defaults is QGIS Modeller?

I am sure I am missing something simple but as it is I need to pull them down from the list every time.  I want to set them as permanent calls.

Using fixed QGIS modeler vector input parameter? seems to deal with files but it doesn't make sense to me either.


texts: "Problem loading output layers" error when running algorithms on rasters in QGIS

texts:
I am trying to delineate a catchment from SRTM 1arc second data in QGIS. For this, I first try to use the Fill Sinks algorithm and then the Catchment Area algorithm. Both of the operations gives a "Problem loading output layers" error, as follows:

Load grid: C:\Users\Douw\AppData\Local\Temp\processing\36e1cab1d1424b9fa4584d564393ad6d\demclip1.sgrd...
failed
Usage: saga_cmd ta_preprocessor 3 -DEM [-RESULT ] [-MINSLOPE ]
-DEM: DEM
Grid (input)
-RESULT: Filled DEM
Grid (output)
-MINSLOPE: Minimum Slope [Degree]
Floating point
Minimum: 0.000000
Default: 0.010000
Error: Grid file could not be opened.
Error: input file [C:\Users\Douw\AppData\Local\Temp\processing\36e1cab1d1424b9fa4584d564393ad6d\demclip1.sgrd]
Error: DEM
Error: executing tool [Fill Sinks (Planchon/Darboux, 2001)]


texts:
This line:

arcpy.Snap_edit("vst", [["ps_vst", "VERTEX", "0.02 meters"], ["ps_vst", "EDGE", "0.03 meters"]])

gives:

Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\edit.py", line 221, in Snap
    raise e
RuntimeError: Object: Error in executing tool

What is the problem?


texts: how to get every images's pixel values of "ImageCollection" in GEE

texts:
I create a Sentinel-2 cloud free mosaic image with Google Earth Engine and exported the image to an Earth Engine asset.

I know the image that I exported was composed by several images that taken at the same place in different time.

I want to obtain the pixel value change of my region of interest.
However, I have problem with exporting every pixel value of those images (take at same place but different time).

Could anyone tell me how to do?
Please help me!!!

Here's the code with text.

// Filter an image collection by date and region to make a
// min pixel composite.

// Create a S2 composite for 2015-06-01 to 2017-10-24, and filter by
// the bounds of the FeatureCollection.
var COPERNICUS = ee.ImageCollection('COPERNICUS/S2')
    .filterDate('2015-06-01', '2017-10-24')
    .filterBounds(geometry);

// Select the min pixel.
var min = COPERNICUS.min();

// Select the red, green and blue bands.
var result = min.select('B4', 'B3', 'B2');
Map.addLayer(result, {gain: '0.1, 0.1, 0.1',scale:10});
Map.setCenter(135.3735, 34.4794, 5);

var band4 = result.select('B4').rename('b4_min')
.addBands(result.select('B3').rename('b3_min'))
.addBands(result.select('B2').rename('b2_min'));

// Export the image to an Earth Engine asset.
Export.image.toAsset({
  image: result,
  description: 'S2min10m',
  assetId: 'S2min10m',
  scale: 10,
  maxPixels: 1e10,
  region: geometry,
});


texts: PostGIS generate lanes for multilinestring map (ST_OffsetCurve)

texts:
I currently have a road network for specific area as multilinestrings. It only shows the road as a single line. I would like to generate lanes for that as well, using some kind of offset. The problem is that ST_OffsetCurve only generates some weird curved shapes. Any ideas how to accomplish this?

SELECT St_offsetcurve(thegeom, 2, 'quad_segs=4 join=round') AS
  theoffset
FROM   (
          SELECT (St_Dump(the_geom)).geom as thegeom
            FROM   public.roadmap
           WHERE  land='SP'
             AND ST_IsValid(the_geom)) AS subquery

Gives me something like this:


texts: Why does OpenLayers display red tiles for USGS map?

texts:
I am trying to display the USGS national map via OpenLayers: http://viewer.nationalmap.gov/viewer/

OpenLayers is able to display the USGS map. However, when I zoom in, the tiles turn red. Could someone explain how to fix this?

Is there a USGS restriction on zoon levels?

Thanks


texts: Point file with addresses, geocode Polygons

texts:
I have a point file of stores in New York/New Jersey. The point file's attribute table has a field called addresses.

I also have a building footprint polygon file with the outlines of buildings.

Is there a way to assign each point to a polygon?


texts: What does ArcMap's Network Analyst tool actually do when more than one facility is loaded?

texts:
I built a network dataset (a system of roads) and loaded multiple facilities in the "Facilities" layer of the NA window.

I clicked "Solve" to run the analysis and saw that my network lines now have calculated distances.

I wonder, what are these distances?

The online documentation is unclear. Under "Multiple Facilities Option", there is an explanation of how the tool handles polygons from multiple facilities, but no mention of how it handles the ToCumul_Length column created in the resulting service area.


texts: Inverse Distance Weighted Python error in QGIS 2.0

texts:
When I wanto to use the command Inverse Distance Weighted in QGIS 2.0, I want to execute as batch process but when I open file it appears a window that say Error de Python

This is what it says:

  Traceback (most recent call last):   File
  "C:/PROGRA~1/QGISDU~1/apps/qgis/./python/plugins\processing\gui\BatchInputSelectionPanel.py",
  line 70, in showSelectionDialog
      self.text.setText(str(files[0])) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 71: ordinal not in
  range(128)

Python Version:

2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS Version:

2.0.1-Dufour Dufour, ebebdf3

  Ruta de Python: ['C:/PROGRA~1/QGISDU~1/apps/qgis/./python/plugins\processing', 'C:/PROGRA~1/QGISDU~1/apps/qgis/./python', 'C:\Users\Genesis/.qgis2/python', 'C:\Users\Genesis/.qgis2/python/plugins', 'C:/PROGRA~1/QGISDU~1/apps/qgis/./python/plugins', 'C:\PROGRA~1\QGISDU~1\bin\python27.zip', 'C:\PROGRA~1\QGISDU~1\apps\Python27\DLLs', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\plat-win', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\lib-tk', 'C:\PROGRA~1\QGISDU~1\bin', 'C:\PROGRA~1\QGISDU~1\apps\Python27', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA~1\QGISDU~1\apps\qgis\python\plugins\fTools\tools']

I am working with a shp file that contains a point list from a whatershed


texts: How to create a trigger for multiple schemas?

texts:
One of my PostgreSQL databases contains different schemas which share the same structure.

-- schema region_a
CREATE TABLE region_a.point (
gid serial NOT NULL,
geom geometry(point, SRID),
attribute_sample varchar(255),
CONSTRAINT point_pkey PRIMARY KEY (gid)
);

CREATE TABLE region_a.polygon (
gid serial NOT NULL,
geom geometry(polygon, SRID),
attribute varchar(255),
CONSTRAINT polygon_pkey PRIMARY KEY (gid)
);

-- schema region_b
CREATE TABLE region_b.point (
gid serial NOT NULL,
geom geometry(point, SRID),
attribute_sample varchar(255),
CONSTRAINT point_pkey PRIMARY KEY (gid)
);

CREATE TABLE region_b.polygon (
gid serial NOT NULL,
geom geometry(polygon, SRID),
attribute varchar(255),
CONSTRAINT polygon_pkey PRIMARY KEY (gid)
);

-- schema region_c
-- ...

Now I wonder how to create a trigger to add sample points on the polygon features within a schema.

CREATE OR REPLACE FUNCTION sample_attribute_from_polygon()
RETURNS trigger AS $body$
    BEGIN
        NEW.attribute_sample = (SELECT attribute FROM polygon
        WHERE ST_Within(NEW.geom, polygon.geom));
        RETURN NEW;
    END;
$body$ LANGUAGE plpgsql;

CREATE TRIGGER sample_attribute_from_polygon_tg BEFORE INSERT OR UPDATE
ON point FOR EACH ROW
EXECUTE PROCEDURE sample_attribute_from_polygon();

Is there any way to use the same trigger for all schemas? I'm looking for a solution that's also working when renaming a schema.


texts: How to create a spatial polygon from 2 known spatial data points in r?

texts:
I have 2 spatial data points which have UTM coordinates.
I want to create spatial polygons of 100x20m using these 2 points as boundary references (see picture).

Background: This for the purpose of assigning carbon values to these polygons.
I've done an inventory some inventory work within these boundaries.
How do I create these polygons in R?


texts: "The submitted field shape_length does not exsists in the table" error while using ArcGIS API for Python, clone_items to clone dashboard

texts:
I am cloning a dashboard from an ArcGIS Online account to a Portal using the clone_item function found in ArcGIS API for Python.
The most common error I get is: The submitted field "shape_length"/"shape_area" does not exist in the table.
The following is the code I am using:
source_gis = arcgis.gis.GIS("https://arcgis.com","username","password")
target_gis = arcgis.gis.GIS("https://server.com/portal", "username","password")

item = source_gis.content.get("<item-id>")

target_gis.content.clone_items([item], copy_data=True, search_existing_items=False)


texts: Is there a relation between EPSG 4326 coordinates and meters?

texts:
I have information about different locations in a Java List. Each location has it's coordinates (longitude and latitude)
For example:

longitude = 2.37364
latitude = 42.38473

I need to look up using an API which bus stations are near each location (in a radius of 500m).

I want to know how can I relate the coordinate system with meters to filter the search.


texts: Problems editing geometry in JS script using a find task in a web application

texts:
I've generated a javascript code to my app based on the sample "Show find task results in a DataGrid" of ArcGIS API for JavaScript and I am using editable layers (WFS-T) and it works, but when after use it I try to select the data to change the geometry and edit it only allows to me edit the attributes, but I can't select the vertexs/nodes of the geometry by double-clicking.

This trouble only appears when I make a search, but not before use it.

How can I make my data editable again?

I've eliminated the graphics with map.graphics.hide() that I've generated before for the query and to store the data on the grid, and it works, but I've the problem with editing geometries.

If anyone can help me it would be very helpful! Thanks


texts: Snapping start- and end nodes of lines to other lines in PostGIS

texts:
There are plenty examples that show how to snap lines to points, but I haven't been able to find any (fast!) way of snapping the start- and end nodes of line strings to nodes of other lines.

Essentially I want to "clean" my layer in postgis (2.0), moving nearly-similar points together, and sewing up tiny openings between line strings.

It wouldn't matter so much whether I add another node, move the first/last node of either line, or move both points to the center.

I have found two options, but I'm not sure how to start with either of them:

Use topology: http://lists.osgeo.org/pipermail/postgis-users/2012-May/034024.html
Explode lines, snap nodes, merge nodes. http://www.mail-archive.com/postgis-users@lists.osgeo.org/msg00174.html

The second option sounds feasible, but any help on how to follow this method would be greatly appreciated.


texts: Is HTML pop-up tool available in ArcReader?

texts:
I've published a water and sewer map that has as-built plans in PMF format attached to a buffer feature class around the utilities' piping. When I open the published map in ArcReader I can access the PMFs using the identify tool. I read on ESRI's blog that the attachments can also be accessed using the HTML pop-up tool.

"HTML pop-ups are a useful way to view multiple attachments for a feature at the same time. They work not only in ArcGIS Desktop but also in web applications, ArcGIS Explorer, or ArcReader."

I cannot find the tool in ArcReader. Am I missing it or is it just not available in ArcReader?

I am using ArcMap 10.4.0.5524 and ArcReader 10.4. The blog that I read saying that HTML pop-up was available in ArcReader was dated Spring of 2011.


texts: Date filtered for collection on Google Earth Engine

texts:
Is it possible to select from a collection of images for example of 30 years and ask only the image of July for each year? The below only include July images for a single year.
var aoi = ee.Geometry.Point([0, 10])
Map.addLayer(aoi)
var collection = ee.ImageCollection('COPERNICUS/S2')
  .filterBounds(aoi)
  .filterDate('2020-07-01', '2020-08-01')


texts: Download global data efficiently from Google Earth Engine

texts:
I want to get the GPP of MODIS from Google Earth Engine on a global scale, here is my code.
var start_date = ee.Date.fromYMD(2000,1,1);
var end_date=ee.Date.fromYMD(2005,1,1);
var Date_window=ee.Number(365);
var n_year=end_date.difference(start_date,'year').round();
print(n_year);
var dates =ee.List.sequence(0,n_year,1);
function make_datelist(n){
  return start_date.advance(n,'year');
}
dates=dates.map(make_datelist);
function getrg(d1){
  var dg=ee.Date(d1).getRange('year');
  return dg;
}
var daterg= dates.map(getrg);
print(daterg,'daterg');

var roi_simple =
    ee.Geometry.Polygon(
        [[[-180, 90],
          [180, 90],
          [180, -90],
          [-180, -90]]], null, false);
Map.centerObject(roi_simple,1);
Map.addLayer(roi_simple);
var i=0;
var imgcol=ee.List([]);
var num_daterg=daterg.size().getInfo();
while(i<num_daterg){
  var dt=daterg.get(i);
  var imageCollection= ee.ImageCollection('MODIS/006/MOD17A2H')
                  .filterDate(dt).select('Gpp');

  var num = imageCollection.size().getInfo();
  var num_list=imageCollection.toList(num);
  var image1 =ee.Image(num_list.get(0));

   var image_sum=imageCollection.sum();

  var image_reprojected=image_sum.reproject('EPSG:32631',null,500);

 var image_cal= image_reprojected.multiply(0.0001);
  imgcol=imgcol.add(image_cal);
  var nameOut = image1.id().getInfo();

  Export.image.toDrive({
    image: image_cal,
    description: 'sumGpp_'+ nameOut,
    folder: 'MODIS_sumGpp_500m',
    region: roi_simple,
    scale: 500,
    maxPixels: 1e13
  });
  i++;
}
print(imgcol,'imgcol');

I think the progress is too slow. Could this code be changed to be more efficient?


texts: Cronjob to load OSM data into PostgreSQL with ogr2ogr fails

texts:
I try to load daily updates from OSM into a PostgreSQL database. For this I download daily dumps from Geofabrik and load them into my database using ogr2ogr.

My script runs fine when running from command line, however, when I run it as a cronjob (as the same user as I used for the command line), some of the larger files don't get uploaded.

I wrote the output from ogr2ogr into a logfile and got this:

INFO:root:Download http://download.geofabrik.de/africa/equatorial-guinea-latest.osm.pbf
INFO:root:Load file into PostgreSQL
INFO:root:''
INFO:root:Download http://download.geofabrik.de/africa/cameroon-latest.osm.pbf
INFO:root:Load file into PostgreSQL
INFO:root:'ERROR 1: Cannot copy /vsimem/osm_importer/osm_temp_nodes_0x7581a0 to ./osm_tmp_nodes3242959232_0\n'
DEBUG:root:Load file into PostgreSQL
INFO:root:'ERROR 1: Cannot copy /vsimem/osm_importer/osm_temp_nodes_0x115c1a0 to ./osm_tmp_nodes396976512_0\n'
INFO:root:Refresh materialized view CMR
INFO:root:Download http://download.geofabrik.de/africa/congo-democratic-republic-latest.osm.pbf
INFO:root:Load file into PostgreSQL
INFO:root:'ERROR 1: Cannot copy /vsimem/osm_importer/osm_temp_nodes_0x79c130 to ./osm_tmp_nodes4052980096_0\n'
DEBUG:root:Load file into PostgreSQL
INFO:root:'ERROR 1: Cannot copy /vsimem/osm_importer/osm_temp_nodes_0xbee130 to ./osm_tmp_nodes2294854016_0\n'
INFO:root:Refresh materialized view COD
INFO:root:Download http://download.geofabrik.de/africa/congo-brazzaville-latest.osm.pbf
INFO:root:Load file into PostgreSQL
INFO:root:''

As mentioned before, I don't get this error when running the script directly. I use the same settings for all files I download. Some of them work, other not.

Does anyone have a hint why my cronjob is failing?


texts: Splitting ID number along hyphens and creating new field with only parts of ID In Field Calculator?

texts:
I have a shapefile with polygons and each polygon has an ID number that follows a pattern like this:

SMP_ID
1077-1-1
8-2-2
1281-1-3
304-2-1

In have created a new field and I need to populate it with a truncated version of these IDs, which would look like this:

SYS_ID
1077-1
8-2
1281-1
304-2

This is the code I've been fiddling with most recently, I feel like it's the closest...

def getSysID(SMP_ID):
 if SMP_ID is None:
  return None
 else:
  SysID = SMP_ID.split('-')[0] + '-' + SMP_ID.split('-')[1]
  return SysID

I also tried this method:

id_vals = !SMP_ID!.split("-")

SYS_ID = id_vals[0] + "-" + id_vals[1]

remainder = id_vals[2]

Something isn't working right, though! There are a few IDs from a different source that don't follow this pattern and are just a string of numbers without hyphens, I'm wondering if that could be a part of the problem?

I'm looking for a solution that will ignore the non-hyphenated IDs and nulls, and copy the truncated hyphenated IDs into a new field.


texts: What causes ERROR 000210: Cannot create output in_memory\AND from ArcPy?

texts:
The ArcGIS for Desktop "ERROR 000210: Cannot create output" has been reported on this site a number of times but an in_memory workspace seems to have been implicated only once:

  ERROR 000210: Cannot create output in_memory

which was in Getting 000210 Error trying to wirte output to in_memory workspace in ModelBuilder?

I have just encountered the same error message from ArcPy, using ArcGIS 10.2.2 for Desktop both in a Python script tool and from IDLE.

I have determined the cause and so I am asking a question in order to provide an answer to anyone who may encounter it in future.

What causes the error message below from ArcPy?

ExecuteError: ERROR 000210: Cannot create output in_memory\AND
Failed to execute (CopyFeatures)


texts: Why does the data type change from int to float when exporting layers?

texts: When I export Shapefile layers to Mapinfo format or Shapefile format integer values are automatically converted into float. Is there anything I can do to avoid this?


texts: How to pass GeoJSON array to datatable dynamically using Javascript

texts:
I want to pass one GeoJSON file to a dynamically created datatable using Javascript, I am unable to identify the column names in the file. I have tried this:

        fC.type
        f.type
        f.prop
        f.geom.type
        geometry.coordinates.0
        geometry.coordinates.1

 $(document).ready(function() {
 $('#example').dataTable( {

  "ajax":"data/json_file.json",
  "processing":true,
  "columns": [

    { "mData": "type" },
    { "mData": "features.type" },
   { "mData": "features.properties" },
    { "mData": "geometry.type" },
   { "mData": "geometry.coordinates.0" },
   { "mData": "geometry.coordinates.1" }
  ]
 });
 });

And the GeoJSON file is

{
   "type": "FeatureCollection",
   "features": [
   {
      "type": "Feature",
       "properties": {},
       "geometry": {
       "type": "LineString",
       "coordinates": [
           [
            40.078125,
            57.136239319177434
           ],
           [
            91.7578125,
            58.99531118795094
           ]
                      ]
                  }
      }
   ]
}


texts:
I have a polygon shapefile that has several attributes.

I would like to know how can I create automatically a vector file for each one.

I already find split vector layer in QGIS (like picture):

but I want to use python.

I found a way through the web site at the following site, but this caused an error in QGIS.

https://docs.qgis.org/2.8/en/docs/user_manual/processing_algs/qgis/vector_general_tools/splitvectorlayer.html

>>> import processing
>>> processing.runalg('qgis:splitvectorlayer')
ERROR: Algorithm not found

So I need another way to split..


texts: Developing maps using Tile Mill and Processing(.org)?

texts:
I had a small question. I actually would like to build an application which is very similar to this but as a  map and not on “Multi touch Table Top”.

The functionality I need is

Plot different cities of California with different radii. The radius will represent the number of times a person has visited a city.
When a person clicks on a city (e.g LA) it should show a polyline to other cities which are nearby, as shown in the link above.

I was wondering if anyone could help with this and give me some pointers on how to get started which would be real great.


texts: Managing or Reducing noise in a mosaic raster

texts:
I have created a raster with the Mosaic to New Raster tool from 3 separate rasters. However in my mosaic I have some consecutive pixels which seem to be the noise of the previous procedure. Is there any tool or something as to isolate them transforming them to No Data?

I have no idea how much overlapping was and I think the method I used was the default "Last".


texts: FeatureServer layer losing connection to Feature Class layers (ArcMap/ArcServer) on adding .lyr

texts:
This is a question about using feature services as layers in ArcMap.

We have a issue where layer (.lyr) files (source from feature services) are not displaying individual feature classes when added to new ArcMap documents.

the set up is as follows:

SQL Server 2008 with both SDE (& non-SDE) database(s).
ArcGIS Server 10.2 (Serving data as Map Service & Feature Service) & security to  Map services is handled by (windows) network authentication.
ArcMap 10.2.2 to display the layers.

We have many feature classes within the feature service (as they cover the same theme).  If we add the Feature Service (From GISServer - ArcServer) to ArcMap document it loads as a group layer (as there are many feature classes) & if the feature service is used to create a .lyr again it load fine to ArcMap (as a group layer).

However if we want to use the individual feature classes, so save out layers (now called Feature Service Feature Classes) of each feature class there is a red explanation mark (I.e. missing data source) once loaded to a new map document.  This does not happen if you use a .lyr of 2 or more of the feature classes (so displayed as a group layer)

Has anyone else seen anything like this, is it a know issue?  We might be using an incorrect method to share these feature classes internally or there is a security side we have not considered.


texts:
The versionName "JNMILLER" won't delete. Any idea why it's not finding the name?

Terminal:

================= RESTART: C:\Users\jnmiller\Desktop\test.py
=================
Found - "EGAS\JMEESE"
Found - "EGAS\MWETZEL"
Found - SDE
Found - sde
Found - "EGAS\JNMILLER"
Found - "EGAS\SCRAWFORD"
Found - "EGAS\CCOON"
Done
>>>

Code:

# Name: DeleteVersion.py
# Description: Deletes a version

# Import system modules
import arcpy

# Set local variables
arcpy.env.workspace = "Database Connections/NEO_1.sde"
connection = arcpy.env.workspace
versionName = "JNMILLER"

# Execute DeleteVersion
for version in arcpy.da.ListVersions(connection):
    print "Found - {0}".format(version.name.split(".")[0])
    if version.name.split(".")[0] == versionName:
        arcpy.DeleteVersion_management(connection, versionName)
        print("Deleting version {0}".format(version.name))

print("Done")


texts: Using the qgis2web plugin to export layers?

texts:
Using the qgis2web plugin on QGIS Desktop, is it possible to export the layers to an HTML file that already exists?

I already know how to use QGIS server. I'm trying not to use a server for this solution.


texts: Is it possible to create one raster elevation layer from two different point layers in QGIS?

texts:
I have two layers with X,Y,Z data. The data overlay only partly.

Is it possible to create one raster layer with elevation data using the 2 sets of data but without merging them first?


texts: When joining .xlsx to state .shp, exporting feature class, why are attribute names not retained?

texts:
I have a shapefile of the U.S. states, and tabular data that I joined to it based on the state name. The data was downloaded in .csv format, but it didn't carry over some number categories when I joined. So I converted it to a .xlsx, appropriate formatted each column and re-did the join. After that, all of the columns name and information was available.

Now, I have to export the combined data as a new feature class. When I do that, the column names change to have additional text (states_STA, states_SUB, states_S_2, etc.), or to shorten themselves, and therefore removing the identifiable information.

What can I change in my work flow so that the original column names will remain the same?


texts: Select polygons with other polygons layer?

texts:
I have to select some polygons with another polygon layer. I have to select green polygons using relevant overlapping percentage with the purple ones. In this particular example, I would like to select all green polygons except the third one from starting from above for example.

Do you have any advice to do that?


texts:
Point in polygon does not appear in my QGIS 2.18.0 (Windows 10).

The tutorials indicate I should find it in Vector -> Analisis Tools -> Point in Polygons, but it is not there.

How should I install it?


texts: Getting list of distinct values from shapefile field using QGIS?

texts:
I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named 'city_name' and by stating 'city_name = "London"' in the where clause only London is displayed. What I would like to do now is to fetch all values in 'city_name' from the attribute table.

Something like that:

select distinct city_name from [attribute table]

I found several tools in QGIS apparently dealing with SQL and I also had a quick look at the different Plugins. But I fail at connecting to a database or the table name ... what database or which table in that case?

In the end I want to export the result list and use it for further processing.

I am using QGIS 1.8.


texts:
I'm trying to use ArcGIS Pro 2.3 and this tutorial (https://medium.com/geoai/high-resolution-land-cover-mapping-using-deep-learning-7126fee571dd) to use the function "Classify Pixels Using Deep Learning" to classify buildings. I was able to train the .h5 U-Net model, but I'm getting the following error message on the last step of the tutorial:

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
 Unable to obtain configuration properties associated with the raster function.
 Traceback (most recent call last):
 File "S:\ArcGIS\Pro\Resources\Raster\Functions\System\DeepLearning\ImageClassifier.py", line 132, in getConfiguration
 configuration = self.child_image_classifier.getConfiguration(**scalars)
 File "s:\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\Keras\DeepLab.py", line 46, in getConfiguration
 image_tensor = self.classification_graph.get_tensor_by_name('ImageTensor:0')
 File "C:\Users\Luiz\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\site-packages\tensorflow\python\framework\ops.py", line 3654, in get_tensor_by_name
 return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
 File "C:\Users\Luiz\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\site-packages\tensorflow\python\framework\ops.py", line 3478, in as_graph_element
 return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
 File "C:\Users\Luiz\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\site-packages\tensorflow\python\framework\ops.py", line 3520, in _as_graph_element_locked
 "graph." % (repr(name), repr(op_name)))
 KeyError: "The name 'ImageTensor:0' refers to a Tensor which does not exist. The operation, 'ImageTensor', does not exist in the graph."
 Configuration properties returned by the python raster function is not a python dictionary.
 Failed to execute (ClassifyPixelsUsingDeepLearning).

I believe the error is in:  KeyError: "The name 'ImageTensor:0' refers to a Tensor which does not exist. The operation, 'ImageTensor', does not exist in the graph."

Did anyone encounter a similar problem?


texts: Create a point for each line not-along the lines

texts:
I would like to automatically create a vector of points.

The vector should be composed of one point per each line of a line vector (approx 3000 features). Those points should be placed near each line but not along them.
The best result would happen if points were created in a direction perpendicular to each line, 1 meter far from each line.

In order to have an example, the following image shows the desired result:


texts: Rename cells in Attribute Table to 'XXX.$ID'

texts:
I feel like this should be easy to answer, but I can't get it to work for me. I need to edit the attribute table of a .gpx file before I load it into my GPS, in order to label the points. I can rename each point with $ID, but I have several files and want to be able to distinguish between them. I would like to be able to name them something like "500m.1" "500m.2"... "1km.1" "1km.2"... etc.

I can use the expression 500+$ID to give me "501" "502" etc. but that will become difficult to read for some of the files. How can I combine text with $ID in a single cell? All my attempts so far result in 'Expression is invalid'.


texts:
I have been trying to save my CSV file using the "Save As" from a right click as suggested on many websites, but I literally can't see this button. See my picture attached (on the left my QGIS 3.2 interface, on the right a blog extract based on QGIS 2.8), is that a bug?

I am trying to do that to save my data with another CRS that would match my shapefile so that I can calculate my buffer with a unit different from my CSV file.


texts: Click event on maps with Folium and information retrieval

texts:
I was wondering if there is a way in Folium to get the information on an entity we click on with Folium?

I'd like the map to either open a tab with the attribute information or just send back information on the entity selected without necessarily using a popup.


texts: Algorithm to move polygon nodes when simplifying

texts:
I want to simplify polygons that come from a raster analysis. In order to avoid overlap and gaps, I first convert my polygons to lines. The problem is that all algorithm are then keeping the two end points, which are not necessarily at the best position. The image below illustrates my problem (it is difficult to explain by words). The "manual" case is the kind of result that I expect (of course I cannot do this manually for all features because I have far to many of them):

With Wang's algorithm, I have some bends around the node and it is
away from the straight line that I would like
With DP algorithm, I have the straight lines but they are shifted compared with the line that I would like.

My priority is to keep a good positional accuracy (minimizing the distance from the "middle" of the line).  I would like a "T"(though not necessarily right angles) like I have with DP algorithm, but at a location that would make the lines close to the "middle" of the original lines.

I prefer solutions in QGIS 2.0 or ArcGIS 10.1 (advanced) but the implementation is a bonus for me. My question is about an algorithm that would help me find the best location of the polygon nodes for "non shifted straight lines".


texts: Adding an existing Feature class to an existing Feature Dataset in c#(arcobjects)

texts:
I want to add an existing feature class to an existing feature dataset. Both the feature class and the dataset have the same coordinate system, I searched over the net but only assistance I found was to create a new feature class in a feature dataset (I tried that and it worked). According my understanding I tried using IDatasetContainer but it's not working. Here is the code:

IFeatureDataset featureDataset1 = featureWorkspace.OpenFeatureDataset("featureDataset1");
IDataset datasetFcTenActors = fc_tenActors as IDataset;  // fc_tenActors is my feature class to add
IDatasetContainer container = featureDataset1 as IDatasetContainer;
container.AddDataset(datasetFcTenActors);


texts: How to get connection info from an .ags connection file?

texts:
I am working on a Python script to manage ArcGIS Server services (publish new services, update existing services, delete old services, etc.) in batch across multiple environments (e.g. dev, test and production) and instances (2+ per environment).

To publish services, you can use ArcPy and AGS connection files, but to do anything beyond that (e.g. list existing services, start/stop/delete services), you need to use the AGS Admin REST API, which uses token-based authentication, and to get a token you need to submit the user's name and password.

Having to specify the server URL, username and password each time would be tedious for the user, especially if they are working with more than one AGS instance at a time, as my script does. I'd much prefer if they could just use their preexisting AGS connection files instead, which they need for publishing regardless.

Is there any way to get the connection info (e.g. server URL, username, password) from an AGS connection (.ags) file programmatically -- ideally with Python? arcpy.Describe considers them dumb files and can't do anything with them.

If there's no way to do that then I suppose I will have to require an additional configuration step to generate and store the tokens locally for a long duration as it would be too cumbersome to have to prompt the user for credentials for each AGS instance every time they use the script.


texts: Unable to style KML layer in OpenLayers 3

texts:
I have KML data, which looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document><Folder><name>City</name>
<Schema name="City" id="City">
<SimpleField name="Name" type="string"></SimpleField>
<SimpleField name="Description" type="string"></SimpleField>
<SimpleField name="LINK" type="string"></SimpleField>
</Schema>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#City">
<SimpleData name="LINK">1 City</SimpleData>
</SchemaData></ExtendedData>
<LineString><coordinates>...some coordinates...</coordinates>    </LineString>
</Placemark>
... goes on

I want to load this layer, add it to the map and style it. I tried it like so:

var source = new ol.source.Vector({
    url: 'city.kml',
    format: new ol.format.KML({
        projection: 'EPSG:3857',
        extractStyles: false
    })
});

function styleFunction(feature) {
    var style = new ol.style.Style({
        stroke: new ol.style.Stroke({
        color: 'red',
        width: 4
        })
    })
    return [style];
}

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

As you can see, I set extractStyles to false, in order to use my own styles. And in style function I have a style just for a LineString (stroke), because in the data source I see almost only LineString tags. Still, all this does not work.

PS: I should add, that the file with data is loaded well

- I clearly see it in the console.


texts:
I understand how to join these two, however, I am having some issues. I am attempting to join a set of lines to a polygon that I have drawn. I want the polyline attributes to join to the limited table for the polygon. Basically I have some routes that run through the drawn polygon, and I want the polygon table to show the attributes of the affected lines to display in the table.

I would guess the spatial join is the way to go, but when I join, the data does not migrate into the table. It shows little data, and no select-able features. I have all data projected properly.


texts: I'm looking for code to implement a Gaussian plume model in 3D.  Any suggestions on where to start? Are there any python scripts out there?


texts:
How can I extract all buildings, blocks, polygon features from OpenStreetMap?

I used OSMDownloader and QuickOSM QGIS plugin to download geospatial data for Saudi Arabia region. I was able to download some buildings, but I need all buildings from the selected region.


texts: Display an image on a Leaflet map using geojson attributes

texts:
I have a geojson file "test.geojson" which contains image metadata for multiple images, including image url (as browseUrl) and image bounds (as imageBounds).

What I want to do is to display a corresponding image on my leaflet map by clicking on it's shape using ImageOverlay. Here is my code:

$.getJSON("test.geojson", function (geojson) {
    var geojsonLayer = new L.GeoJSON(geojson, {
        onEachFeature: function (feature, layer) {
            layer.on('click', function (feature) {
                L.imageOverlay(feature.properties.browseurl, feature.properties.imageBounds).addTo(map)
            })
        }
    }).addTo(map);
});

Unfortunatelly I get Uncaught TypeError: Cannot read property 'browseurl' of undefined when I click on a feature.


texts: Finding the common borders between polygons in the same shapefile

texts: The question is essentially the same as here, except that I want to do it in qgis. Thus, is there a qgis function equivalent to the ArcMap intersect function that will take a polygon layer and output the line segments corresponding to the intersections (common boundaries) of two polygons. (I realize that since polygons are independent objects in shapefiles, satisfying the intent of the query is more challenging than in a topolically modeled division of the surface.)


texts: Accessing polygon geometries from a geodataframe - keep getting a key error

texts:
I have two geodataframes. One of about 5000 points (geolocated by me using GoogleV3, and one of 25000 polygons (from a govt-provided shapefile).
Every point will be in one (and unless only one) polygon. I would like to identify which polygon the point is in.
I am struggling to conceptualize how to do this, particularly as I cannot seem to access the 'geometry' column of the geodataframe that was imported by the shapefile.
For example, if I call
foo = offices.loc[3,'geometry']

I get a point: the coordinates of the 4th item in the GDF.
However, if I call
bar = zones.loc[3,'geometry']

I get a KeyError
bar = zones.loc[3,'geometry']
Traceback (most recent call last):

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
    return self._engine.get_loc(casted_key)

  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc

  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc

  File "pandas/_libs/hashtable_class_helper.pxi", line 1625, in pandas._libs.hashtable.Int64HashTable.get_item

  File "pandas/_libs/hashtable_class_helper.pxi", line 1632, in pandas._libs.hashtable.Int64HashTable.get_item

KeyError: 3

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "<ipython-input-17-8f543fae5979>", line 1, in <module>
    bar = zones.loc[3,'geometry']

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexing.py", line 889, in __getitem__
    return self._getitem_tuple(key)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexing.py", line 1060, in _getitem_tuple
    return self._getitem_lowerdim(tup)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexing.py", line 807, in _getitem_lowerdim
    section = self._getitem_axis(key, axis=i)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexing.py", line 1124, in _getitem_axis
    return self._get_label(key, axis=axis)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexing.py", line 1073, in _get_label
    return self.obj.xs(label, axis=axis)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/generic.py", line 3739, in xs
    loc = index.get_loc(key)

  File "/opt/anaconda3/envs/Geolocating/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
    raise KeyError(key) from err

KeyError: 3

I have no idea where to even begin, since I can't access specific rows to check if the point is within the polygon.


texts: Recovering forgotten password on ArcGIS toolbox (.tbx)?

texts:
I made an ArcGIS toolbox (.tbx) using ModelBuilder on ArcGIS 10.2 last year and I have to edit something on that tool but I forget the password of that tool.

How can I recover or do anything to edit that tool?


texts:
I am having problems adding occurrence data to openModeller and I think that the format might be the problem.

I am using Excel with the fields: #ID Taxon Name Longitude Latitude.

I saved the result on a .txt format but openModeller won't detect it.


texts:
With the Make Service Area tool in ArcGIS Network Analyst, the output is a Vector layer, and the break values relate to what impedance values you pass in (e.g. 5, 10, 20 minutes or miles).

What tool(s) in ArcGIS allows me to create a continuous layer (raster) for a service area?


texts: Creating asset folder using Google Earth Engine Python API

texts:
I am trying to create an asset folder using

ee.data.createFolder()

But I get the error:

  AttributeError: module 'ee.data' has no attribute 'createFolder'

How do I create a folder using the python api?


texts: Overlaying raster image with different geographic extent using ArcGIS Desktop?

texts:
I have two raster image i.e A & B of different geographical extent. A image have the large geographical extent with raster value of 1 whereas B image is cover the smaller geographical extent within the area of A image.

The raster value of B image is 0. I want to overlay B image on A image and keep the raster value of 0 on B image area and rest of the area should be 1 as given in below picture.

I required resultant image same as C image but unfortunately I got the result of B image geographical extent only.

How can I do this in ArcGIS Desktop?
Is it possible to raster overlay/calculation with different geographical extended images?


texts: Google earth Engine: extract specific values returned by frequencyHistogram()

texts:
I am trying to filter/subset/extract a specific value from the output returned by frequencyHistogram().

I am not sure how to do this, and not sure what is the class of that output (help file says list), or whether I should convert this to another class, like dictionary or array?

Say I wanted to know the cell count associated to cell value 10001, how can I do this?

// Take raster and polygon
var image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00').select('B[2-5]');
var region = ee.Geometry.Rectangle(-122.45, 37.74, -122.4, 37.8);

// run histogram on raster, on region defined by polygon
var tryit = image.reduceRegion(ee.Reducer.frequencyHistogram(), region, 30).get("B2");
print(tryit, "tryit")

//how can I extract the cell count associated to cell value, say 10001?


texts: In which situations are statistical assumptions (e.g. multivariate normal distribution within spectral classes) for parametric classifiers (e.g. maximum likelihood ) not valid for land-cover classification?


texts: Searching Related Tables in ArcGIS Online

texts: The point of this project is to find the deceased's name in a cemetery so the public can find them easily. I have uploaded a shapefile of cemetery lots and a table of lot occupants (so I did a 1:Many join). The configured pop-up windows will show the occupants when I click "Show Related Records". However, I can only search through the source layer, not the related records. Ideally, I could search "Bob Smith" and it would take me to the right polygon, but this is not possible. From my research, I haven't found any work-arounds (no widget or web application template works). I don't want to split every polygon so I can add all the occupants names in, that would take ages. Would a query table help? Does anybody know of any?


texts: What is the maximum Theoretical accuracy of GPS?

texts:
I was talking with a potential client, and they requested that we plot some points with GPS, with a maximum (or should that be minimum?) accuracy of 2 m.

This is an area with no WAAS, and I was under the impression that even in the best of conditions, a single gps point can be accurate up-to only 15 meters(Horizontal field). Is this correct?

What is the maximum theoretical accuracy of GPS without using WAAS or differential GPS?


texts:
Is there any chance to calculate line lengths by category. To be precise, I have 4 road categories (state, county, local and uncategorized) and want to calculate them all within one poligone.

So far, I could calculate the lengths for all of them together, using Vector>Analysis tools>Basic statistics, in QGIS 2.10.1-Pisa. It provides me with some statistical information, like standard deviation, what I do not need.

Do I have to make 4 shape files for calculate one category of the road, or is there an add-on or a formula to calculate it?


texts: Error when creating PostGIS extension in pgAdmin4

texts:
I am trying to create a PostGIS extension in pgAdmin4.

When typing CREATE EXTENSION postgis;, or through "db_name > Create > Extension > General > Name = postgis", I get this error:

  ERROR: could not load library "C:/Program
  Files/PostgreSQL/12/lib/postgis-2.5.dll": The specified procedure
  could not be found.

What I have done so far:

1) I've checked this question that addressed the same issue, and moved the two .dlls ("libeay32.dll" and "ssleay32.dll"), as suggested, but the error remains.

2) I have verified that "libxml2-2.dll" is in the bin folder.

3) I've restarted pgAdmin4 but didn't help as well.

Does anyone have any suggestion?

Version:
PostgreSQL 12.1, compiled by Visual C++ build 1914, 64-bit / PostGIS 2.5.3


texts: How can i figure out what Geoprocessing Tool is selected in ArcMap? (ArcMap 10)

texts:
I am working on an arcobjects extension, that basically provides universal batch / task scheduling for the geoprocessing tools (similar to ERDAS's Batch/Scheduling System), the project is 99.9% complete.

Anyways my issue is, i have looked, and looked, dug through the API, searched, posted questions on ESRI's forums (got no answer) for the last few days. However i cannot find any method for retrieving the currently selected geoprocessing tool.

What i have tried (blank map no layers loaded):

Accessing the IMxDocument.SelectedItem, and IActiveView.SelectedItem, seem to return a com object with a empty guid string (i am guessing its only for layers etc)
Trying to hook into the underlying Arctoolbox tree (i cannot figure out what it is though) via the hwnd (i was desperate)
IApplication.CurrentTool, this returns null

Most curiously there is an IArcToolBoxFind, and a IArcToolBoxTool within the ESRI.Framework, which is where i would expect this kind of functionality to reside in. However i cannot find any examples, of this anywhere. Nor can i find any sort of documentation, and according to the object model there is nothing.

EDIT Nevermind ignore the comment about the above two they are for implementing an arctoolbox.

Does anyone have any ideas?

EDIT 2
Its basically a universal, batch/scheduling tool. When the user opens any of the tools i first want to open a custom dialog, then the geoprocessing dialog however in order to open the georpocessing dialog without actually having the event go to the geoprocessor you need a handle on IGPTool, or something similar. However to find this i would need to know what geoprocessing tool is opened.

Also i found a solution, which is basically use arccatalogue + the tree browser, toolboxes showup within the tree. And you can easily find out what is selected. This is just a stop gate solution however but yeah damn it esri.


texts: I have a doubt about INSPIRE directive. In case a Member States of EU does not have cartography of Land Cover, it is bound to produce it?


texts: rasterVis plot3D in R: obtain consistent x-y axes with extent() / projection() shown in RasterLayer object

texts:
I have a RasterLayer object z:

class       : RasterLayer

dimensions  : 100, 100, 10000  (nrow, ncol, ncell)

resolution  : 0.06534037, 0.03165736  (x, y)

extent      : -96.63908, -90.10505, 40.36051, 43.52624  (xmin, xmax, ymin, ymax)

coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0

data source : in memory

names       : layer

values      : 0.001829022, 2.227507  (min, max)

The latitude and longitude coordinates shown with extent(z) represents the state of Iowa in the U.S.  The function plot(z) produces a plot with the x-y axes consistent with the coordinates represented with extent(z), as well as the coordinate reference with projection(z) shown above.

However, the function plot3D(z) produces a plot with the x-y axes inconsistent with the coordinates represented with extent(z), and the coordinate reference with projection(z) shown above.  The function plot3D(z) is apparently using a different coordinate reference system than what is shown above in my RasterLayer object z.

Question: I would like the axes on the 3D plot (using the function plot3D) to continue using the latitude and longitude shown with extent(z), which is also consistent with the reference coordinate system projection(z) shown above.

A reproducible example for illustration:

library(maps)

library(maptools)

library(akima)

library(raster)

library(rasterVis)

library(rgl)

x <- runif(10, -95, -92)

y <- runif(10, 41, 43)

intensity <- runif(10, 0, 2)

iowa <- map("state", "iowa", fill = TRUE, col = "transparent", plot = TRUE)

iowa.spat <- map2SpatialPolygons(iowa, IDs = c("iowa"))

interp <- interp.new(x, y, intensity,

                     xo = seq(min(iowa$x, na.rm = TRUE),

                              max(iowa$x, na.rm = TRUE), length = 100),

                     yo = seq(min(iowa$y, na.rm = TRUE),

                              max(iowa$y, na.rm = TRUE), length = 100),

                     extrap = TRUE)

interp.raster <- raster(interp)

z <- mask(interp.raster, iowa.spat)

z

plot(z)

rgl::open3d()

plot3D(z)

decorate3d()


texts: Invalid Geometry - Which column can I change to geometry?

texts:
I have a csv file with thes two columns (amongst others): localisation and geo_point_2d.

Here is the content of one cell of localisation :

{"type": "MultiPolygon", "coordinates": [[[[-53.5441768169403, 5.50647948448245], [-53.5467839241028, 5.50461059944752], [-53.5478729009628, 5.5055717410565], [-53.5473901033401, 5.50614308560981], [-53.5477602481842, 5.50646346549284], [-53.5460811853409, 5.50824691035157], [-53.5441768169403, 5.50647948448245]]]]}

Here is the content of the cell on the same line as the previous one in the column 'geo_point_2d':

5.50638356893;-53.5461903708

I migrated the table to postgis and tried to change the types of these columns to geometry with :

ALTER TABLE my_table_name
ALTER COLUMN localisation TYPE geometry

For the column geo_point_2d I get :

ERROR:  parse error - invalid geometry
HINT:  "5.50638356893;" <-- parse error at position 14 within geometry
SQL state: XX000

I tried to change the ; by , but the error was still there.

For the column localisation I get :

ERROR:  parse error - invalid geometry
HINT:  "{"" <-- parse error at position 2 within geometry
SQL state: XX000

In the best case I would like to access to polygons instead of points. When getting the csv file a GeoJson files is also available but I needed to make some changes in the document before visualizing it. The GeoJson displays well on QGis.
I guess I am under ESPG:4326

My question is : How can I get to change the type of the columns to geometry ?


texts: Create many Layers and data views with arcpy

texts:
This code I've created works for 1 (one) active layer and for 1 (one) field. I need to implement this code for many layers and fields in a open .mxd file.

I have 11 fields (years 2003 to 2015). I want to select some o of them (multivalue field) and after choose, generate the layers view to each field (year). I already did for 1 (one) field.  But get stuck to many layers.

The shapefiles are from the same region/place so the best way to view is the layout view (create more than 1 data view)

The process  is:

i. choose the table
ii. choose the years (multivalue field)
iii. generate N data views from the selected fields

import arcpy

mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "")[0]
lyr = arcpy.mapping.ListLayers(mxd, "", df)[0]
lyrFile = arcpy.mapping.Layer(r"F:\PercACH.lyr")
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)
Tabela = arcpy.GetParameterAsText(0)
Campo = arcpy.GetParameterAsText(1)

if lyr.symbologyType == "GRADUATED_COLORS":
    lyr.symbology.valueField = Campo

arcpy.mapping.ExportToPDF(mxd, r"F:\TesteAgro.pdf")
arcpy.RefreshActiveView()
arcpy.RefreshTOC()

del mxd, lyrFile

EDIT:

What`s the best way to create many layers and data view for every year selected?


texts: Why are REST LOD (scales) different to the WMTS Capabilities XML

texts:
I have an internally published ArcGIS webmap. The Rest's Level Of Detail (LOD) reports  a different number to the WMTS capabilities XML. I checked out a few public services, and found the exact same thing..

Why are these numbers different. What am I missing?

REST MapServer:
USGS Topo MapServer

WMTS XML:
USGS Topo MapServer WMTS XML

ff


texts: How to prevent field to be replaced by objectid field when copying from sde to local file geodatabase

texts:
Im copying tables from a sde database to a local file geodatabase using Table To Table
First two columns in SDE table when previewed in ArcCatalog:

This is the local copy of the sde table:

As you can see the AGOSLAG_ID field has been replaced with OBJECTID field, and the values have been lost.
How can i get the AGOSLAG_ID field to stay unchanged?


texts:
ST_Snap just work in 2D...
It is possible to add a 3D Point to 3D Polygon? ST_3DSnap :(
Or add ST_3DClosestPoint to polygon.

SELECT DISTINCT ST_Snap(a.geom, b.geom, 0.001) as geom. 2D only.


texts: Saving map as image using MapCanvas in PyQGIS

texts:
I have created a standalone application to display the vector layer using PyQGIS code given below. Now I want to download the map which shows on the window with whatever the zoom level I have chosen.

from qgis.gui import *
from qgis.PyQt.QtWidgets import QAction, QMainWindow
from qgis.PyQt.QtCore import Qt

class MyWnd(QMainWindow):
  def __init__(self, layer):
    QMainWindow.__init__(self)

    self.canvas = QgsMapCanvas()
    self.canvas.setCanvasColor(Qt.white)

    self.canvas.setExtent(layer.extent())
    self.canvas.setLayers([layer])

    self.setCentralWidget(self.canvas)

    self.actionZoomIn = QAction("Zoom in", self)
    self.actionZoomOut = QAction("Zoom out", self)
    self.actionPan = QAction("Pan", self)

    self.actionZoomIn.setCheckable(True)
    self.actionZoomOut.setCheckable(True)
    self.actionPan.setCheckable(True)

    self.actionZoomIn.triggered.connect(self.zoomIn)
    self.actionZoomOut.triggered.connect(self.zoomOut)
    self.actionPan.triggered.connect(self.pan)

    self.toolbar = self.addToolBar("Canvas actions")
    self.toolbar.addAction(self.actionZoomIn)
    self.toolbar.addAction(self.actionZoomOut)
    self.toolbar.addAction(self.actionPan)

    # create the map tools
    self.toolPan = QgsMapToolPan(self.canvas)
    self.toolPan.setAction(self.actionPan)
    self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
    self.toolZoomIn.setAction(self.actionZoomIn)
    self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
    self.toolZoomOut.setAction(self.actionZoomOut)

    self.pan()

  def zoomIn(self):
    self.canvas.setMapTool(self.toolZoomIn)

  def zoomOut(self):
    self.canvas.setMapTool(self.toolZoomOut)

  def pan(self):
    self.canvas.setMapTool(self.toolPan)

w = MyWnd(iface.activeLayer())
w.show()

No idea how to provide a download option within this window.


texts: DB Manager connection to PostgreSQL failed

texts:
I try to load a postgis raster layer. I would like to add the raster by connection with DB Manager an drag and drop into canvas.

  Connection with DB Manager failed with error: UnicodeDecodeError:
  'ascii' codec can't decode byte 0xfc in position 34: ordinal not in
  range(128)

Connections to other databases are possible. Also it is possible to add shapes.


texts:
I have a question with a query in PostGIS. I try to calculate the area from a polygon. It actually works but the area-result is not correct.
My Query is:

SELECT
name, ST_Area(way)/10000 AS hectares
FROM
osm_data
ORDER BY hectares DESC
LIMIT 1;

The problem is, that the amount of ha is completely wrong.
So i tryed to change the EPSG in the standard 4326 EPSG. But when I use than the query it shows me an error:

SELECT
name,ST_Transform ((way, 4326)ST_Area(way))/10000 AS hectares
FROM
planet_osm_polygon
ORDER BY hectares DESC
LIMIT 1;

  SQL state: 42601

Where is the mistake?!


texts: When calculating a field in an attribute table, how can I find one value out of many fields when every other field has a null value?

texts:
I have 4,018 rows of data with about 50 fields. About 45 of those fields are the same variable, but the data came from different layers, so out of those 45 fields, only one has a value for the row, the rest are null. I just need the actual value in my final field. I used a string wildcard to identify the right fields. This code returns NULL for every row.
def n():
    import arcpy
    fields = arcpy.ListFields('Extract_fires')
    for f in fields:
        if f == 'AVGPRE*' and f is not None:
            return(f)


texts: What does the shape_length field of a polygon represent?

texts: I have some irregularly shaped polygons existing within an Esri geodatabase. What does the 'shape_length' field represent geometrically? i.e. Does it represent the furthest distance between two points?


texts: Creating a drop-down list for arcpy script tool

texts:
I have written the following script but I cannot manage to create the drop-down list for the variable "select" (select=arcpy.GetParameterAsText(3)).
Any suggestions?

# Script arguments
inputRaster = arcpy.GetParameterAsText(0)
cost = arcpy.GetParameterAsText(1)
bene = arcpy.GetParameterAsText(2)

#import Raster
rast = Raster(inputRaster)

#make calculations
rast1 = rast / rast.maximum

rast2 = 1-(rast / rast.maximum)

#Save the output rasters
rast1.save(cost)
rast2.save(bene)

#create a list from rasters
namelist = [rast1,rast2]

select = namelist

#select from a drop-down list
select = arcpy.GetParameterAsText(3)

#Script arguments
weight = arcpy.GetParameterAsText(4)
output = arcpy.GetParameterAsText(5)

#make calculations
selected = Raster(select)
ws = selected * weight
ws.save(output)

I have defined the "select" as "string", is it correct? Also, I have made some edits in validation tab.


texts: Do rasters other than "north up" exist in the wild?

texts:
"North-up" (as I understand it) refers to raster images stored with the northerly direction at top, and each subsequent line of pixels is a bit farther southward. Rasters' georeferencing metadata usually include

the coordinates of the origin; this is the top-left pixel for a north-up image.
the horizontal and vertical pixel size; the vertical size is negative for a north-up image. (ESRI World File reference; GDAL reference)

Every raster I've seen has followed this convention. Do rasters ever exist in the wild whose vertical pixel step size is not negative?  If so, what motivates this orientation?


texts:
I'm aware that this is the hundreth(possibly more) time someone asked about the distance matrix that is expressed in degrees, but should be in meters. I read most of the questions, online guides, etc., but there must be something I am doing wrong and I cannot figure out what. So here we go:

I open a project in QGIS (3.4.15). I set the project CSR to "WGS 84 / UTM zone 32N", as I read that UTM is generally expressed in meters.
I load two (csv) layers with an ID, longtitude and latitude data. One has specific events, the other with locations of households (of survey data). I load both with the same "WGS 84 / UTM zone 32N" csr.
I check whether under "project properties" the right CSR is really set (WGS 84 / UTM zone 32N) and if distance measurements are set to meters. All is correct.

Then I run the distance matrix, but the units are expressed as degrees.
I also tried loading the layers with another CSR (WGS84+GRS80 / Mercator) and reprojecting them to the UTM csr, and using the new reprojected layers to calculate the distance matrix. Again, degrees.

Would someone have advice or insight as to what I'm doing wrong? Any help is greatly appreciated as creating the matrix takes 45-50 mins (large layers) and I spend 1.5 days on this already.


texts: Create new date for temporal layer in QGIS

texts:
I have a bunch of features (e.g. 'sampling point 1') and am storing a bunch of environmental data for each feature (e.g. 'pH', 'EC', etc.) plus a date. The new time manager for QGIS makes exploring this data great.
However, what I can't figure out is some simple way of inputting new data. Specifically I would like to recreate each feature for each new date so that the attribute table that originally looked something like this:
fid | name    | pH  | date
--- | ---     | --- | ---
1   | point 1 | 6   | 1990-01-01
2   | point 2 | 5   | 1990-01-01
3   | point 1 | 7   | 2020-05-01
4   | point 2 | 7   | 2020-05-01

Could be updated to something like this:
fid | name    | pH   | date
--- | ---     | ---  | ---
1   | point 1 | 6    | 1990-01-01
2   | point 2 | 5    | 1990-01-01
3   | point 1 | 7    | 2020-05-01
4   | point 2 | 7    | 2020-05-01
5   | point 1 | NULL | 2020-06-01
6   | point 2 | NULL | 2020-06-01

I can filter by the latest date, select the filtered features, copy the selected features, paste as a new temporary layer, change the date and attributes and then copy these features and paste them back into the original layer. But that seems very convoluted.
Is there a simpler way to create a new date for the features in a layer? Or am I just approaching the problem wrong way?


texts: Including MIcrosoft Word document in QGIS layout?

texts:
How can I include a document and personal table from MSword to Qgis layout?

In Arcgis is possible include linked docs from .docx.


texts: How to select specific rows of polygons from a grid in QGIS?

texts:
I have a polygon layer. I would like to select every second row of the polygons but not manually. Is there an expression to select every second row as seen on the picture with Select by expression in QGIS?

*(Numbers refer to the polygon's "ID")


texts: Why does ArcMap drag and drop report "one or more dropped items invalid"?

texts:
I've noticed that I can drag and drop data sets into a custom tool within ArcCatalog 10.1, but if I launch the tool in ArcMap and try to drag and drop layers already in my TOC, I get an error

  one or more dropped items invalid

but I can browse to it and load that way.


texts: display GeoReferencing image through MapServer

texts:
I have a tiff image and got the world file which contains the needed information for GeoReferenceing,

how to start add this image on Mapserver ? if I use C# and use GMAP API to call the google server through internet to show map.

how to add this map with correct coordinate on it ?
if I have to replace this API to have a local map server to use, it is ok as long as I still can use the new mapserver and API with C# windows application.

any suggestion? I have many times add similar to this question but all people answer to use GDAL, but I think GDAL to get the needed information which is already having them in the world file ?


texts: Saving Map Canvas as PNG with transparent background programmatically with QGIS?

texts:
I wrote a script to create a big number of heat maps for a given scenario. I would like to save the result of every heat map as an PNG image. I have figured it out doing it with simple Map Rendering but the quality of the result is too low. Furthermore I would like to export to OpenLayers using the same code, which does not seem to be possible with simple rendering.

Now I am trying to do it with QgsComposition instead. Manually in the Map Composer you can just set the paper color to transparent and disable the background of the map canvas.

This is the code that I have so far. I just cannot figure out why it is not working. The result png-file always has a white opaque background.

My OS is Windows 7 and I'm using QGIS 2.6 Brighton.

I hope someone can help me out here.

# PARAMETERS
mainPath = 'path/to/folder/'
filename = 'filename'
imageType = "png"
imageWidth_mm = 400
imageHeight_mm = 160
dpi = 300

mapRenderer = iface.mapCanvas().mapRenderer()

c = QgsComposition(mapRenderer)
c.setPlotStyle(QgsComposition.Print)

c.setPaperSize(400, 160)

x, y = 0, 0
w, h = c.paperWidth(), c.paperHeight()
composerMap = QgsComposerMap(c, x ,y, w, h)
c.addItem(composerMap)

# get all items and disable the backgrounds
itemList = c.items()
c.removeItem(itemList[2])
c.removeItem(itemList[2])
itemList[2].setBackgroundEnabled(False)
itemList[3].setBackgroundEnabled(False)
# add them to the composition
c.addItem(itemList[2])
c.addItem(itemList[3])

c.refreshItems()
c.refreshDataDefinedProperty(QgsComposerObject.AllProperties)

c.setPrintResolution(dpi)
dpmm = dpi / 25.4
width = int(dpmm * c.paperWidth())
height = int(dpmm * c.paperHeight())

# create output image and initialize it
# image = QImage(QSize(width, height), QImage.Format_ARGB32)
image = QImage(QSize(width, height), QImage.Format_ARGB32_Premultiplied)
image.setDotsPerMeterX(dpmm * 1000)
image.setDotsPerMeterY(dpmm * 1000)
#image.fill(0)

imagePainter = QPainter(image)

# This part does not seem to have any effect
#brush = QBrush(Qt.BrushStyle(0)) # transparent brush
#
#imagePainter.setBackgroundMode(0)
#c.setBackgroundBrush(brush)

c.renderPage( imagePainter, 0 )
imagePainter.end()

imageFilename =  mainPath + filename + '.' + imageType
image.save(imageFilename, imageType)
print 'image saved'
print 'done'


texts: How to register a Stored Procedure in ArcSDE?

texts:
I just registered a SQL Server view with ArcSDE through

sdetable -o register [...].

I wonder, how to register a SQL Server stored procedure with ArcSDE? Is it the same process as the view?

EDIT

It seems that to register a stored procedure, it is required to have a "stable" database object: the definition of the stored procedure by itself it is just a piece of code that has no sense until it is executed with some input parameters.

Ok, so, if we consider the stored procedure as a "data collection generator", how would you execute this code with the input parameters, catch the tabular data output and register it to ArcSDE? What would you use? Some kind of ArcGIS processing?

Please, could you provide any example or guidelines for this process?

Thanks!


texts:
I have hdf files of monthly ocean productivity, but the data is not displaying on my map. I tried to unzip the file twice, define the projection, extract the subdataset, create a mosaic dataset, and add rasters to the mosaic dataset. Below are the website of the data and my results from ArcGIS Desktop.

http://orca.science.oregonstate.edu/1080.by.2160.monthly.hdf.vgpm.m.chl.m.sst.php


texts: Creating python list of feature classes or layers using ArcPy

texts:
Step 1: I will generate a series of point feature classes. Each will have half the distance between points as its predecessor.
Step 2: I then want to cycle over those point feature classes, but in reverse.
Can I create a list of feature classes or layers as I go in step 1, so I can reverse through it in step 2?


texts: ecognition- template matching result export

texts:
I am doing template matching for tree detection purpose using ecognition software. When I export the point layer result from ecognition into QGIS using the 'export the existing vector layer function',  QGIS couldn't recognize the CRS of the vector layer (different in size and coordinates) and I need to use transformation to put them into correct place but it's not really accurate.

Can anyone help me with this issue?


texts: Aster L1T: Radiance -product to surface reflectance

texts:
Earth Engine provides access to Aster level 1 Precision Terrain Corrected Registered At-Sensor Radiance -product (Aster L1T). I would be interested to reach the surface reflectance values of the image collection, to be able to use them in NDVI time-series analyses. Are there any algorithms ready for the processing steps needed?

DN to at sensor radiance. (radiance = ((DN - 1) * Unit Conversion Coefficient)
At sebor radiance to top of the atmosphere reflectance.
(Can one use Landsat equation? This would require earth-sun distance and irradiance information)
Atmospheric corrections to reach surface reflectance.
(any ready equations for aster data?)

For the first step I tried code below, but it returns Null values

    var dataset = ee.ImageCollection('ASTER/AST_L1T_003')
                      .filter(ee.Filter.date('2014-10-01', '2014-10-30'))
                      .filterBounds(AOI)
                      .filterMetadata('CLOUDCOVER', 'less_than', 20);

    // red and NIR channel digital numbers to at sensor radiance
    var radianceValues = function(img) {
        var gainRED = img.get('GAIN_COEFFICIENT_B02');
        var gainNIR = img.get('GAIN_COEFFICIENT_B3N');
        var rad_RED = (img.select('B02') - 1) * gainRED;
        var rad_NIR = (img.select('B3N') - 1) * gainNIR;
        return img.addBands(rad_RED, rad_NIR);
    };

    // add red and nir band with radiance values
    var radianceBands = dataset.map(radianceValues);


texts: Export attribute table (feature class) to text file in batch?

texts:
What would be the most efficient way to export attribute tables from multiple feature class files stored in a file geodatabase? Export to .txt or .csv. Is there any sort of batch process? Or python script?

I have hundreds of files within this geodatabase and really need to automate this process.


texts: Point size based on the scale and point color based on the attribute in SLD

texts:
I want to edit points size based on the scale and also I want to set up colors based on one attribute column (Quantities in ArcMap, 10 classes).

I already wrote SLD rules for colors, but I don't know how to insert maxscale and minscale for the same points.

For example my SLD looks like this:

<sld:Rule>
          <sld:Name>0,000001 - 0,363959</sld:Name>
          <sld:Title>0,000001 - 0,363959</sld:Title>
          <ogc:Filter>
            <ogc:PropertyIsBetween>
              <ogc:PropertyName>attribute</ogc:PropertyName>
              <ogc:LowerBoundary>
                <ogc:Literal>1E-06</ogc:Literal>
              </ogc:LowerBoundary>
              <ogc:UpperBoundary>
                <ogc:Literal>0.363959</ogc:Literal>
              </ogc:UpperBoundary>
            </ogc:PropertyIsBetween>
          </ogc:Filter>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>circle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#5ABA00</sld:CssParameter>
                  <sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:Size>4</sld:Size>
              <sld:Rotation>0</sld:Rotation>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>
        <sld:Rule>
          <sld:Name>0,363960 - 1,414790</sld:Name>
          <sld:Title>0,363960 - 1,414790</sld:Title>
          <ogc:Filter>
            <ogc:PropertyIsBetween>
              <ogc:PropertyName>attribute</ogc:PropertyName>
              <ogc:LowerBoundary>
                <ogc:Literal>0.36396</ogc:Literal>
              </ogc:LowerBoundary>
              <ogc:UpperBoundary>
                <ogc:Literal>1.41479</ogc:Literal>
              </ogc:UpperBoundary>
            </ogc:PropertyIsBetween>
          </ogc:Filter>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>circle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#83CF00</sld:CssParameter>
                  <sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:Size>4</sld:Size>
              <sld:Rotation>0</sld:Rotation>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>

So, where to insert max scale and min scale rule? How to insert it? What value to set up (max zoom out must be Australia).

It is pretty emercency, and thank you so much.


texts:
Using this article as a guide, I've been trying to connect points to the nearest location on a line road feature class. This works until the last step, the Points To Line tool. It consistently gives a runtime error 999999: Error executing function.

999999 errors don't really tell me what's going wrong. This has occurred on different machines. On opening the script for the tool, it imports arcpy, os and types. Not familiar with the types module. It also has the lines

  if name == 'main':
      convertPoints()

although I don't see the main function anywhere. Any ideas?


texts: How to resolve encoding errors in python geoprocessing?

texts:
I have a simple python script that reads a string from a text file and inserts it into an Oracle database.

When I run the script with Eclipse using Pydev plugin I get no error and the message is inserted into database.

However, when I run the script using an ArcGIS geoprocessing service (using a toolbox), I get the following error in the logs, and no insertion is performed into database:

[06/09/2013-10:30:39.380] ERROR - APPLICATION <module>(<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u"INSERT INTO APPLI.ALERT (ID_ALERT,MESSAGE,TYPE_ALERT) values(1617.0,q'[Les coordonn\xe9es ne sont pas correctes\n]',3)", 94, 95, 'ordinal not in range(128)'))

The code is the following:

try:
    msg=open("myFile.log", 'r')
    a=msg.read(20)
    strInsert = "INSERT INTO  APPLI.ALERT(ID_ALERT,MESSAGE,TYPE_ALERT) values(1625.0,'"+a.replace('\"','').decode('utf-8')+"',3)"
    logger_module.debug(str(strInsert))
    SdeExecuteSQL(CONNEXION_FILE,strInsert )
except:
    python_error_handler()

When I open myFile.log with Notepad++ the encoding is ANSI as UTF-8.

Do you have any hint?


texts: Keeping decimals after spatial location joining using QGIS?

texts:
I am merging two layers, a data file and shapefile based on spatial location.

I am doing a many to one type join and I want my attribute to take a summary of the intersecting features, using mean data.

When the join takes the mean of attributes I want an answer with decimal points. It should be a messy number like 3.8739 but instead it rounds up or down so I get 3 or 4. I suspect this has something to do with the 'Precision' feature but I don't know how to use it!

For 3 decimal points do I want a precision of 3.00000?


texts: ArcGIS Geocoding set everything to the same location

texts: I'm trying to geocode a bunch of locations (~4500) in Washington, DC based off their addresses. However, when I run it through the geocoding tool, each point gets set to the same XY location. What's the deal? Are there any other alternatives?


texts: How to find intersecting features from inside a drawn polygon

texts:
I have drawn a polygon and I want to get all the intersecting features. But here I got stuck and not able to proceed.When I run the code it allows me to draw the polygon in the map. But I am not very sure how to get all the intersecting features from that geometry.
Can you please help me. Here is what I did.

IMxApplication pMxApp = null;
IActiveView activeView = default(IActiveView);

pMxApp = (IMxApplication)m_application;

IMxDocument m_MxDoc = (IMxDocument)m_application.Document;
activeView = (IActiveView)(Map)m_MxDoc.FocusMap;

IMap pMap = default(IMap);
ISpatialReference pSpatialRef = default(ISpatialReference);

pMap = m_MxDoc.FocusMap;
pSpatialRef = pMap.SpatialReference;

IScreenDisplay m_pDisplay = activeView.ScreenDisplay;

ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;

screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)
ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast
ESRI.ArcGIS.Display.IRgbColor rgbColor = new
ESRI.ArcGIS.Display.RgbColorClass();
rgbColor.Transparency = 000;

ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit cast.
ESRI.ArcGIS.Display.ISimpleFillSymbol simpleFillSymbol = new
ESRI.ArcGIS.Display.SimpleFillSymbolClass();
simpleFillSymbol.Color = color;

ESRI.ArcGIS.Display.ISymbol symbol = simpleFillSymbol as
ESRI.ArcGIS.Display.ISymbol; // Dynamic cast.
ESRI.ArcGIS.Display.IRubberBand rubberBand = new
ESRI.ArcGIS.Display.RubberPolygonClass();
ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay,
symbol);
screenDisplay.SetSymbol(symbol);
screenDisplay.DrawPolygon(geometry);

m_pDisplay.FinishDrawing();
geometry.SnapToSpatialReference();

ISpatialFilter spatialFilter = new SpatialFilter();
spatialFilter.Geometry = geometry;
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

IElement element = new PolygonElementClass();
element.Geometry = geometry;


texts:
If it is possible to open and visualize a KML Network Link in QGIS, then what are the steps involved?
KML Network Links are described at Google Earth Network Links Explained and at Using Network Links Effectively:

In the most generic sense, a KML file with a network link acts as a
gateway into the content on your server. Your users download your KML
file just once, but they will always see the most updated content,
even if you updated it after they download your KML.

A KML file with a network link can be embedded within a KMZ file.


texts: Geoserver MapFishPrintProvider with rtl text reverse the letters

texts:
When sending RTL text to GeoExt.data.MapfishPrintProvider I get the PDF with mirrored text (LTR).

I've added function to reverse the text in the client , but If I add English words inside the RTL text , I will get the english words reversed into RTL...

Is there any solution for this ?

For example :

mapTitle "TEST" will be RTL also...

printProvider = Ext.create('GeoExt.data.MapfishPrintProvider', {
                            method: "POST",
                            timeout : 30*1000,
                            url: "http://xxxxxxx/geoserver/pdf",
                            capabilities: printCapabilities,
                            customParams: {
                                mapTitle: reverse("TEST בדיקה"),
                                comment: "בדיקה",
                                dpi:300,
                                outputFilename : "map.pdf"
                            }});
                    };


texts: ArcMap - ArcObjects IGeoFeatureLayer Renderer is giving a NullReferenceException

texts:
Refactoring a VBA add-in into VB.NET add-in.

I'm getting:

  An unhandled exception of type ' System.NullReferenceException' occured in MyAddin.dll

  Additional information: Object reference not set to an instance of an object.

I have a class that is calling three methods and it's failing on the first method because of the error I'm facing.

        If TypeOf pGFLayer.Renderer Is IUniqueValueRenderer Then
           Call LoadDefaultLegend(pMxDoc, pGFLayer, strSelectedLayer)

           Call RemoveJoin(pMxDoc.FocusMap, pLayer)
           pFLayer.DisplayField = "ACAD_layer"

           Call SelectLayerByName(strSelectedLayer, pMxDoc)
           Exit Sub
        End If

Then in the method it's trying to pass a parameter, but that parameter is giving me the unhandlded exception error (pRend = pGeoLayer.Renderer). The location of the .lyr file is fine.

Any ideas?

Sub LoadDefaultLegend(ByRef pMxDoc As IMxDocument, ByRef pGFLayer As IGeoFeatureLayer, strSelectedLayer As String)
    gstrHomeDir = "C:\MyApps\TestPlugin\MyPlugin\"

    Dim pGxLayer As IGxLayer
    Dim pGxFile As IGxFile

    pGxLayer = New GxLayer
    pGxFile = pGxLayer

    Dim strMxdPath As String
    Dim strLegendPath As String

    strLegendPath = gstrHomeDir & "\Legends\"
    ' Add correct lyr-file (01, 02, 03, ...)
    strLegendPath = strLegendPath & Right(strSelectedLayer, 2) & ".lyr"

    pGxFile.Path = strLegendPath
    Dim pGeoLayer As IGeoFeatureLayer
    pGeoLayer = pGxLayer.Layer

    'Get the Symbology from the layer
    Dim pRend As IFeatureRenderer
    pRend = pGeoLayer.Renderer

    pGFLayer.Renderer = pRend

    pMxDoc.ActiveView.Refresh()
    pMxDoc.UpdateContents()
End Sub


texts:
I am using ArcGIS 'watershed' routine in a script which makes use of multiprocessing.
This works fine, but during execution I get the message:

Unable to remove directory.  Possible causes:
1- Not owner of the directory
2- Another person or application is accessing this directory

EDIT 27/02/14:
I've incorporated the suggestions of using arcpy.Exists (with a very rudimentary way of checking if something didnt exist) and writing all results to disk:

import arcpy
from arcpy import sa
arcpy.CheckOutExtension("Spatial")

def watershed(pnts, flowdir, flowacc):
    direc = tempfile.mkdtemp(dir = "C:\\temp")   #Create a separate directory for files to be written to.
    arcpy.env.scratchWorkspace = direc
    arcpy.env.workspace = direc

    res = []
    for i, p in enumerate(pnts)
        pnt = arcpy.PointGeometry(arcpy.Point(p.x, p.y, ID = i)) # Convert the Shapely point to arcpy point
        pourpt = sa.SnapPourPoint(pnt, flowacc, 10000) #Snap point to high flow acc cell
        if arcpy.Exists(pourpt):
            ws = sa.Watershed(flowdir, pourpt) # Calculate watershed
            if arcpy.Exists(ws):
               out = os.path.join(direc, "poly_%i"%i)
               poly = arcpy.RasterToPolygon_conversion(ws, out) #Convert to polygon
               res.append(poly[0]) # Put the polygon in the results list for this set of points
            else polylist = "NoWS"
        else polylist = "NoPourPt"

    return res

The parallel function remains the same:

def watershed_pll(mod, proc=6):
    """
    Calculate the watershed for each station point using parallel processing
    All relevant data is held in the mod object
    """
    pool = Pool(processes = proc)

    # Iterate over each feature of the drainage path and submit the list of pour points to the worker function
    jobs = []
    for key, val in mod.stations.geometry.iteritems():
        jobs.append((key, pool.apply_async(watershed, (val.points, key, mod.flowdir,
                                           mod.flowacc, rdict))))

    pool.close()
    pool.join()
    return jobs

Sometimes it runs perfectly, other times I get one of various errors such as the initial one above, or also:

FATAL ERROR (INFADI)
MISSING DIRECTORY

and:

ERROR 010088: Invalid input geodataset (Layer, Tin, etc.).]

and:

 ERROR 010050: Cell size is not set.

Which is odd as I explicitly set the cell size within the function...

When it works and when it doesnt seems to be hit and miss/random. Such errors lead me to believe that arcpy is still trying to delete stuff behind the scenes. Is there any way to explicitly prevent it from doing so?

I wonder if my problem could be related to one of two things:

Environments/folders getting mixed up. The input data is passed as complete filepaths to some raster datasets which are outside of the scratchWorkspace (which is set locally for each process) where intermediate/output data is created. However, I have noticed that Arc may make folders (typically and 'info' folder) in the directories of the input data. Why is that? Can it be prevented, or can I prevent Arc from then trying to delete it?
Are there any potential problems with accessing the input raster data sets at the same time? I.e each process will be attempting to open and read from the flow direction and flow accumulation rasters which are passed into the function.


texts: Rasterio and OpenCV reads JPEG differently

texts:
I realise a very similar question was asked  as Rasterio and OpenCV shows two different pixel arrays for same image. However my situation is slightly different and I only wish to know why this difference occurs.
I converted a GeoTIFF (uint16) of mine to JPEG (uint8) via gdal_translate as follows:
gdal_translate -of JPEG -scale ./rgb.tif rgb.jpg

To confirm whether the image was read correctly, I ran the following script (named test.py):
import cv2
import rasterio as rio
from skimage import io
import numpy as np

def check(path):
    # All images should be in RGB mode
    im1 = rio.open(path)
    im1 = im1.read()
    im1 = im1.transpose(1, 2, 0) # CHW to HWC
    im2 = cv2.imread(path)
    im2 = im2[:,:,::-1] # BGR to RGB
    im3 = io.imread(path)

    print(f"Rasterio and OpenCV = {np.all(im1[:,:,0] == im2[:,:,0])}")
    print(f"Rasterio and Skimage = {np.all(im1[:,:,0] == im3[:,:,0])}")

if __name__ == "__main__":
    check("rgb.jpg")

which returns
Rasterio and OpenCV = False
Rasterio and Skimage = True

Apparently OpenCV reads the image differently from rasterio and skimage. I can also confirm rgb.jpg is of type uint8 and is read as such by the three libraries.
So does anyone have an idea as to why this happens? Is this expected behaviour?
Versions:
OS: Ubuntu 16.04
pip = 21.0
python = 3.7.3

Link to image here
How to reproduce
conda create -n s1 -c conda-forge rasterio scikit-image python=3.7
conda activate s1
pip install opencv-python

Running test.py with s1 'fails' as rasterio and cv2 reads image differently.
Adding the output of gdalinfo rgb.jpg
Gdalinfo output
river: JPEG/JPEG JFIF
Files: rgb.jpg
       rgb.jpg.aux.xml
Size is 1000, 1000
Coordinate System is:
PROJCS["unknown",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["latitude_of_center",-90],
    PARAMETER["longitude_of_center",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1],
    AXIS["Easting",NORTH],
    AXIS["Northing",NORTH]]
Origin = (-2383139.439709701109678,1465870.867263491498306)
Pixel Size = (25.610955512797485,-25.610955512797485)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left  (-2383139.440, 1465870.867) ( 58d24'15.47"W, 64d43'49.98"S)
Lower Left  (-2383139.440, 1440259.912) ( 58d51'11.39"W, 64d51'11.12"S)
Upper Right (-2357528.484, 1465870.867) ( 58d 7'38.49"W, 64d55'50.63"S)
Lower Right (-2357528.484, 1440259.912) ( 58d34'42.36"W, 65d 3'15.06"S)
Center      (-2370333.962, 1453065.390) ( 58d29'26.93"W, 64d53'32.72"S)
Band 1 Block=1000x1 Type=Byte, ColorInterp=Red
  Overviews: 500x500, 250x250
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 2 Block=1000x1 Type=Byte, ColorInterp=Green
  Overviews: 500x500, 250x250
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 3 Block=1000x1 Type=Byte, ColorInterp=Blue
  Overviews: 500x500, 250x250
  Image Structure Metadata:
    COMPRESSION=JPEG


texts: Zoom to predefined areas/extents in QGIS

texts: Is there anyway or any plugin to create predefined extents/areas (e.g. cities) that one can zoom to in QGIS? For example, create a city A, define  the extents of the city and when one click on the name of the city then it will be zoomed to the center of it.


texts: Split polygon into smaller polygons based on areas that are covered by lines in ArcGIS Pro

texts:
I am trying to split a map of an island into attribute (primary substation) areas in ArcGIS Pro. I have network locations (lines) which I have split into primary substations (as shown by the image below) on top of a polygon which is the total area of the island.
I was wondering if there is a way that the polygon can be split to give the areas that the lines distribute to. So that there would be a blue area to the north, pink in the centre, purple to the south etc. There are some lines that overlap into another primary substation area so not sure if these can be ignored. Ideally I would like the polygons generated to be touching so that there are no blank areas.
If the polygon can not be split this way is it possible to generate new polygons within the island polygon, but again without blank areas between them.


texts:
I am creating NDVI from Sentinel2 bands 8 and 4 on QGIS, using the raster calculator, but I need to convert the format or clip to a polygon beforehand, because my computer crashes if I try to perform on the raw bands.

If I convert the bands to 32bit beforehand (needed for the end product anyway) or if I clip to polygon to make the raw band a smaller extent, I am finding the raster values change, and not in a consistent manner.
These are some of the differences found between my 'processed' bands and the original bands, comparing my processed NDVI to the calculated NDVI from the raw bands.

I used GDAL warp (near resampling, LZW compression) to change the data type from UInt16 to 32b Float. I also trialed using GDAL translate (no compression) to do the same, and still found the values changed significantly and inconsistently.

Is this all to do with resampling? Is there any way to do this sort of processing on QGIS without altering my raster values?

Any advice would be greatly appreciated, I have searched stackexchange for similar questions, but haven't found anything which could solve my problem.


texts:
I am using leaflet.js for my application. The click event is not triggering alongwith the mouseover event.

   layer.on({
            mouseover: function (e) {
                L.popup().setLatLng(e.latlng)
                .setContent("Test")
                .openOn(map);
            },
            click: function () {
                alert("Click");
                map.fire("click", e);
            }
        });

I am using the custom marker instead of circle marker

     option.pointToLayer = function (feature, latlng) {
         var marker = L.marker(latlng);
                var icon = L.icon({
        iconUrl: 'Image/InvestmentIcons/environmentalflow.png',
        iconSize: [12, 12], // size of the icon
    });

                    marker.options.icon = icon;
                    return marker;
                }


texts: Insert XY table data into SQL Spatial column

texts:
ArcGIS Server 10.1.1 SQL Server Standard 2012
Current workflow is user submits a table (text file) containing lat-long data (same spatial reference each time); SQL Server Integration services pushes this data into an SQL table. Data is viewed as an XY Event Layer in ArcGIS Desktop and published to AGS.

The ideal workflow is to to utilize a Query Layer instead of a XY Event Layer (according to ESRI).

My question is what is the best to get these XY (Lat-Long) fields into the spatial column?

At this point in the workflow, I think we would be limited to SQL commands (or something within SSIS); the table is a text file going into SSIS so I doubt we'd be able to add an appropriately formatted column/field which would could then be mapped/loaded into the spatial column of the target SQL table.

[The question is much less about ArcGIS Server but I added that background for context.]


texts: Copy Features (Data Management) and replace the new features

texts:
I am wondering if there is a method to copy and replace features from a source file geodatabase to destination geodatabase that have the same features name.

example : if i have a file named ( A.gdb) and contains a feature named (life)
          i want to copy the feature (life) to a file (B.gdb) but the problem is B.gdb
          also have the feature (life) already in it, and i need arcmap to replace the
          old feature with the new without giving me that the feature (life ) is already  exists in the destination gdb.

I want to do this in ModelBuilder.