texts: Sentinelsat Python API - download images after scihub IP Change

texts:
I need download Sentinel-2 images. I used this code for like 2 years or more:
def download_S2_by_tile(tiles=[], initialDate='', finalDate='', downloads=''):
    """
    :param tiles: sentinel-2 tiles list, ex:  ['21LYD']
    :param initialDate: initial date of search and download, ex:  2021-03-01 (YYYY-MM-DD)
    :param finalDate: final date
    :param downloads: folder to save the files
    :return:
    """
    from collections import OrderedDict
    from sentinelsat import SentinelAPI

    # Sentinel-2 Copernicus credencials
    user = 'user'
    password = 'password'
    scihub = 'https://apihub.copernicus.eu/apihub'

    # Conecting API
    api = SentinelAPI(user, password, scihub)

    # converting Date intel format
    date_i = '{}{}{}'.format(initialDate[0:4], initialDate[5:7], initialDate[8:])
    date_f = '{}{}{}'.format(finalDate[0:4], finalDate[5:7], finalDate[8:])

    query_kwargs = {
        'platformname': 'Sentinel-2',
        'producttype': 'S2MSI1C',
        'date': (str(date_i), str(date_f)),
        'cloudcoverpercentage': (0, 80)}

    print(query_kwargs)
    products = OrderedDict()
    for tile in tiles:
        kw = query_kwargs.copy()
        kw['tileid'] = tile
        print(kw)
        pp = api.query(**kw)
        products.update(pp)
    if products != {}:
        print(dir(products))
        api.download_all(products=products, directory_path=downloads)

### Executing function to download images ### REPLICABLE EXAMPLE
download_S2_by_tile(tiles=['21LYD'], initialDate='2021-03-01', finalDate='2021-04-01', downloads=r'E:/GEO_Topo')

After SciHub IP change I already changed scihub server website on my code ('https://apihub.copernicus.eu/apihub'). Also, I am using latest version of sentinelsat published in GitHub (https://github.com/sentinelsat/sentinelsat.git), which has a few modifications in order to fix the scihub ip change bugs... But all that I get is this error:
>Fetching archival status: 100%|██████████| 6/6 [00:02<00:00,  2.08 products/s]
Traceback (most recent call last):
  File "E:/PYTHON/MG_Ag_Serv_2/geoProcessing/sentinel_stuffs.py", line 250, in <module>
    download_S2_by_tile(tiles=['21LYD'], initialDate='2021-03-01', finalDate='2021-04-01', downloads=r'E:/GEO_Topo')
  File "E:/PYTHON/MG_Ag_Serv_2/geoProcessing/sentinel_stuffs.py", line 248, in download_S2_by_tile
    api.download_all(products=products, directory_path=downloads)
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\sentinelsat\sentinel.py", line 785, in download_all
    if not dl_task.exception() and dl_task.result():
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\concurrent\futures\_base.py", line 456, in exception
    raise CancelledError()
concurrent.futures._base.CancelledError

How can I fix this? I am using Python from QGIS 3.8.


texts: Enabling Pop-ups by default for all layers in Portal for ArcGIS?

texts:
I would like for Pop-ups to be enabled by default for all layers within portal.

For example, if a user goes to the "Map" tab whithin portal and adds a map service layer, I want "Enable Pop-up" to be set by default. How can I accomplish this?


texts: How to clear spatial reference identifier?

texts:
I created a table in oracle with a sde.st_geometry column. I followed the instructions of ArcGIS help to register the table into geodatabase.

My table creation statement is:

create table tbl_Comm_Cove
(
ID                   NUMBER(10,0)         not null,
Name                 CHAR(200),
Devi_Num             CHAR(8),
Code                 CHAR(200),
Unit_Grid            CHAR(10),
GID                  CHAR(200),
Belo_Road            CHAR(200),
Inst_Time            DATE,
Mana_Depa_ID         NUMBER(10,0),
Owne_Depa            CHAR(200),
Main_Depa            CHAR(200),
Mate_ID              NUMBER(10,0),
Diam                 NUMBER(10,2),
Devi_Stat_ID         NUMBER(10,0),
"Desc"               CHAR(200),
Shap_ID              NUMBER(10,0),
Init_Time            DATE,
Chan_Time            DATE,
Note                 CLOB,
constraint PK_TBL_COMM_COVE primary key (ID)
);
/
alter table tbl_comm_cove add loc sde.st_geometry;
/
CREATE INDEX tbl_comm_cove_idx ON tbl_comm_cove(loc)
INDEXTYPE IS sde.st_spatial_index
PARAMETERS('st_grids=1,3,0 st_srid=0');
/

My registration command is:

sdelayer -o register -l tbl_comm_cove,loc -e p -t st_geometry -R 0 -C id,sde,0 -i sde:oracle11g -s localhost -u XXXXX-p XXXXX

As you can see, I assigned a SRID to my spatial information column "loc".
Now I want to delete this assignment. I tried to do this in ArcCatalog by clicking the "Clear" button in the "XY coordinates" tab of the "Properites" dialog, but when I reopen the ArcCatalog, the assignment is still there.

What should I do?

My oracle version is 11.2.0, Arcgis version is 10.0.


texts: Extra white space in ASCII file due to Translate GDAL from QGIS Modeler

texts:
Could anyone enlighten me why do I get an extra white space in from of my first column in an ASCII file generated through a model? With ArcGIS it doesn't happen.

Output raster type: Int32
Output size: 100.0
Output size is a percentage of input size: Yes

I'm not really sure what extra information should I provide, so if you can by a comment tell what parameter you need to see/know etc.

EDIT: Problem is with the the header files they are too far to the left. I found this out since I'm using a script to process the ASCII file. If I add space to each one, it solves the problem, but it won't help me much since I have quite a lot to fix them.

An example of header from one of my ASCII's (They all have the same specs):

ncols        1233
nrows        1165
xllcorner    989098.010305976960
yllcorner    6389026.025735749900
dx           10.003277779965
dy           10.002517682335
NODATA_value -9999


texts: Exporting features when column value between specific percentiles

texts:
I want to do a statistical analysis. I need to export some features. Their column value between 10%-90% (or 20%-80%) percentile in order to avoid outliers' effect. I can't find a function in the expression window. There are q1, q3, median. They return 25%, 75% and 50% percentile values
There are related posts I found here. None of them meets my need.

Summarizing column in QGIS field calculator? (QGIS, Field Calculator)
Selecting features by quartiles in QGIS (QGIS, Field Calculator, q1 q3)
Identify polygons greater than n-th percentile and perform further analyses using arcpy (ArcGIS, ArcPy)
Calculating Nth percentile from table in ModelBuilder of ArcMap (ArcGIS, Model Builder, no answer)

How can I export features, their column value is between specific range like 10%-90%, 20%-80% etc?


texts: How do I get dwg file in Autocad Civil 3D to align with a georeferenced shapefile and attach coordinate system?

texts:
I am working on a project mapping Rockingham castle for a event help there in August and am mapping the layout and camping area. I'm looking at taking over from the person previously performing this task as he is busy this year.

He has done all the work AutoCAD, whereas I work in GIS, mainly ArcGIS. However my license at home will expire in the future so am trying to start using QGIS and I am on a mac.

I acquired OS Mastermap vector data of the area and sent it to him as a dwg file exported from ArcGIS shapefile.

My main query is how does he align the un-georeferenced dwg file he has used to create the layout to the OSMM and then assign OSGB coordinate system to the dwg layout file and export so that I can import it back into QGIS or ArcGIS? He works in AutoCAD mainly but has Civil 3D at his work.


texts: Remove parts of QGIS 3 toolbars using PyQGIS

texts:
How can I remove specific parts of QGIS toolbar?
I know I can remove toolbars using this line of code:

iface.fileToolBar().setVisible(False)

But what I want is to delete every icon in the fileToolBar except save project and save project as icons, using Python.


texts:
Is anyone aware of a method I could follow to create a QGIS basemap template that predefines styles for x number of vector layers. Ideally, the template GUI accepts any vector data of the correct type, the users points to categories, and the template applies particular styles based on the categories identified by the users.

For example, the template may accept roads and be programmed with styles per functional class, and the user points to a road layer as well as the categories of functional class. Endpoint would be a styles basemap without copying styles between maps, also known as streamline basemap setup.


texts:
Why does ArcGIS Desktop 10.2 add a "Shape_Length" field after running processes?

I'm unable to delete the field after as well. It isn't accurate either.


texts:
I try to build qgis1.8.0 using Microsoft Visual c++ 2010 in a Windows 7 64bit.
all the dependency are installed and the solution qgis1.8.0.sln was generated succesfully.
but my problem is the appearence of those when i build the solution:

  fatal error LNK1104: cannot open file
  '....\core\RelWithDebInfo\qgis_core.lib fatal error LNK1104: cannot
  open file '....\providers\grass\RelWithDebInfo\qgisgrass.lib fatal
  error LNK1104: cannot open file
  '....\analysis\RelWithDebInfo\qgis_analysis.lib

Does anybody know how to fix this issue ?


texts: How to plan preservation of wetland using a DEM and ArcMap?

texts:
I'm trying to plan a wetland preservation. This is the DEM I have:

My aim is to hold as much rainwater as possible in my area of interest (red poly) by building (as few as possible) new and raising existing dams. As the soils are (mostly) impermeable to water I only have to analyse the surface runoff (and plant transpiration, this is done separately). I already tried calculating the watersheds of surrounding pour points (Different watersheds for same area because of "burned streams"). Since I'm not directly interested in where the water comes from which reaches the pour points but concerned where the water is flowing to which falls as rain, I'm asking myself if this is the right way to handle my task or if there are better solutions.

What would be the correct and best practice way to solve this problem?


texts: Seeking highly customizable GIS platform?

texts:
I was educated in GIS using ArcGIS (Desktop and Workstation) and researched with it with (very) short peeks at MapInfo and uDig . During that time, I was satisfied with the program as I used relatively small databases and didn't do a lot of repeat tasks and ArcGIS has a lot of cool tools to analyze scientific data.

For two years now, since graduation, I been working in a company which is in a whole different scale. I deal with huge databases, doing relatively "simpler" tasks, but moreover they are composed of repetitive tasks (I do a series of simple tasks once a week to the whole database). During this time, I've used AutoCAD (as a lot of our data is drawn using AutoCAD) a lot and grew to appreciate it a lot – The greatest advantage is that using the LISP Programming language and using system variables you can control a whole lot of the settings – whether it concerns customizing the default value for a tool, eliminating the use of dialog boxes in the program, or options to script the automatic opening and manipulation of drawings.

Are there any GIS platforms out there, free or not, that have this high level of customizing, or am I doomed to frustrated manual work?

I prefer platforms with a good UI along the scripting options, but that's not a must.


texts: Improve drawing speed when ArcMap layout refreshes?

texts:
I'm working with an 21x26" layout that contains ~ 20 callout graphics. Due to time constraints, I am unable to setup a custom label expression based on attributes and have to work with what I have.

Is there any way to improve ArcMap drawing performance OR force ArcMap not to redraw all graphics each time I perform any action? When working exclusively with data I normally pause the drawing or work in data view, but now I have the unfortunate pleasure of having to edit each callout individually.


texts: Fiona throws no dataset found when attempting to read a KMZ file

texts:
I downloaded a NOAA-provided KMZ file (link). When I point geopandas at the file:

gpd.read_file("/Users/abilogur/Downloads/NSIDC_SepSeaIceExtent.kmz", driver="KMZ")

I get:

FionaValueError: No dataset found at path '/Users/abilogur/Downloads/NSIDC_SepSeaIceExtent.kmz' using drivers: {'KMZ'}

But when I check if the file exists via Python standard lib (import os; os.path.exists('/Users/abilogur/Downloads/NSIDC_SepSeaIceExtent.kmz')) I get True, implying that it does.

What issue am I suffering from?


texts: How to add a variable to a dataset and make sure it matches up properly?

texts:
I have two sets of data that I need to combine. One is a GIS set of points corresponding to the centroids of buildings, the other is a CDV table that has data about what these buildings are used for. I'd like to colour the buildings appropriately depending on this use variable.

This means both adding the bldg_use variable to the attribute table for the centroids, as well as making sure the right use gets assigned to the right building. We use 11-digit codes to name buildings, and this is present in both datasets.

What might I write to automatically check name matches?


texts: ArcGIS Pro Python arcpy.CreatePersonalGDB_management

texts:
I have an ArcGIS Pro Python script (please note it's version 3+ and to be precise shows as 3.66) and when I run the following command, I get an error.

arcpy.CreatePersonalGDB_management(out_folder_path, out_name)

The error is module 'arcpy' has no attribute 'CreatePersonalGDB_management'

The script runs fine when ran under Python 2.7 environment but that's not we need.

Basically, my goal is to copy all Features etc from a File Geodatbase into a Personal Geodatabase and that works by simply copying/pasting inside ArcCatalog. So I am pretty sure my issue is because of the limitation is ArcGIS Pro (and it's version of Python) support for Personal Geodatabase.

So how I do resolve this error? The users will likely not have Python 2.7 in their systems--only will have ArcGIS Pro. I am thinking of including path to a blank Personal Geodatabase .mdb file and simply use something like:

arcpy.Copy_management(target_gdb, target_mdb)

But throws an error that file maybe locked--which doesn't make sense because ArcCatalog is not open.

Any ideas?


texts: ArcGIS Online - How to display map data over time interval

texts:
I have NOAA Tornado data from 1955-2015 that I'd like to display on a map over time. I found an ArcGIS Online Help article describing how to enable time settings but it has me confused. It says:

Verify that you are signed in to your organization and have privileges to create content and publish hosted feature layers.

Open My Content and open the hosted feature layer with temporal data.

In the Layers section of the page, click the small arrow icon next to the layer where you want to enable time and click Time Settings.

Check the box next to Enable time.

Choose to record the time data as specific events in time or time ranges with a start and end time.

Choose the time field or fields in your data.

I'm having issues with Step 3. When I click the arrow icon next to the layer, there is no option for Time Settings:

What am I doing wrong?


texts: zoom by dragging a box in gxp geoexplorer suite

texts:
How to add zoom by dragging a box in gxp opengeo suite?

I need to add the tool box zoom by dragging the mouse

mm yes, but in gxp do not exist


texts: Proper identification of duplicates using spatial and temporal criteria in PostGIS

texts:
I have a table with metadata about sampling locations in the ocean. It includes geographic coordinates, date-time in which sampling was done the number of vertical measurements in each location (nlevels), and the kid of instrument used to take samples (instrument column).

Due to this particular dataset came from historical records, it can include duplicates that I would like to identify using spatiotemporal criteria (allowing rounding errors in spatial coordinates). I would like to detect all stations separated by a distance less than 5km and a temporal difference less than 25 hours

My code for testing was:

CREATE TABLE dups_v2 AS SELECT DISTINCT ON (t1.cast_id) t1.cast_id, t1.date, t1.date_time ,t1.lat, t1.lon, t1.nlevels, t1.instrument
FROM good_dates t1 JOIN good_dates t2
ON ST_DWithin(t1.geom::geography, t2.geom::geography, 5000.0, true)
WHERE AGE(t1.date_time, t2.date_time) < interval '1 days 01:00:00' AND t1.cast_id <> t2.cast_id

The create table looks like:

cast_id  |      date_time      |   lat   |    lon    | nlevels | instrument
----------+---------------------+---------+-----------+---------+------------
 943046   | 1950-02-03 05:00:00 | 25.9200 | -114.5500 |      25 | mbt
 177584   | 1950-02-03 08:00:00 | 25.8200 | -114.8080 |      14 | osd
 943053   | 1950-02-03 08:06:00 | 25.8200 | -114.7700 |      24 | mbt
 943059   | 1950-02-03 10:00:00 | 25.7000 | -114.9700 |      22 | mbt
 4369553  | 1950-03-05 00:00:00 | 25.7720 | -114.8570 |      40 | mbt
 4369511  | 1950-03-05 04:00:00 | 25.9500 | -114.5000 |      38 | mbt
 4369514  | 1950-03-05 05:00:00 | 25.8700 | -114.6500 |      39 | mbt
 178401   | 1950-03-05 07:54:00 | 25.8580 | -114.7500 |       8 | osd
 4369529  | 1950-03-05 07:58:12 | 25.8200 | -114.7500 |      42 | mbt
 944149   | 1950-03-09 00:10:12 | 25.4300 | -113.4700 |      13 | mbt
 944153   | 1950-03-09 13:55:12 | 25.0000 | -112.8300 |      13 | mbt

The time difference looks ok, but spatial separation it is incorrect. For example,  consider the cast ids 944149 and 944153 (the last two) from the above results.

 944149   | 1950-03-09 00:10:12 | 25.4300 | -113.4700 |      13 | mbt
 944153   | 1950-03-09 13:55:12 | 25.0000 | -112.8300 |      13 | mbt

The distance seems to be greater than 5 km.
Thus, is not fulfilling my duplicated definition (< 5km; < 25 hours)

Could you help me to identify my error?


texts: QGIS Print Composer: Is it possible to label only select coordinates?

texts:
On my map frame I want to have the first and last coordinate labels styled differently than the other coordinates (see picture).

I have created two separate grids for the different styles and now want to define which labels to show and which to hide. I have tried to add a custom expression under Draw Coordinates:
 if(@grid_number IN ('4531000','4528000'),'disabled','all')
But, somewhat expectedly, this was unsuccessful.
Is there any way to define which coordinate labels to show (or is there another solution to my problem) within QGIS or do I need to do this in post processing with an external graphics program?


texts:
After converting a raster file to a vector file using gdal.polygonize, I cannot carry out further commands (e.g. Clip) because the vector is produced with invalid geometries (as determined by the QGIS GUI). Within GIS itself, I can correct this by using Fix Geometries, but cannot using Python code outside of the GUI. I can't work out why this happens.

Is there a way to check/make valid geometries in Python/GDAL framework? I have not been able to find anything that works.

src_ds = gdal.Open('input.tif')
if src_ds is None:
    print ('Unable to open %s' % src_filename)
    sys.exit(1)
try:
    srcband = src_ds.GetRasterBand(1)
except RuntimeError:
    print ('Band 1 not found')
    sys.exit(1)

dst_layername = "output/path/filename"
drv = ogr.GetDriverByName("ESRI Shapefile")
if os.path.exists(dst_layername + ".shp"):
    drv.DeleteDataSource(dst_layername + ".shp")

# create spatial reference for the new vector based on the raster
srs = osr.SpatialReference()
srs.ImportFromWkt(src_ds.GetProjection())
dst_layer = dst_ds.CreateLayer(dst_layername, srs = srs)

# create polygon layer
dst_ds = drv.CreateDataSource(dst_layername + ".shp")
gdal.Polygonize(srcband, srcband, dst_layer, -1, [], callback=None)

### fix geometries
processing.run("native:fixgeometries",
        {'INPUT':"output/path/filename.shp",
        'OUTPUT':"output_fixed.shp"})
# > produces a file, but shows nothing


texts:
I'm trying to setup a versioned database to a small office and was wondering whether ESRI's File Geodatabase has that type of capabilities?
Researching the topic I found conflicting data from ESRI's support web site.

On the one hand:

(File Geodatabase) "Versioning support - Only supported as a geodatabase for clients who post updates using checkout and check-in and as a client to which updates can be sent using one-way replication." (http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/types-of-geodatabases.htm)

But than I found this comment from ESRI support team:

"No, versioning is not possible in a file geodatabase. File geodatabases are designed to be edited by a single user and do not support geodatabase versioning. Versioning, a mechanism in which all data edits are recorded as rows in delta tables, is only supported in an enterprise geodatabase." (https://support.esri.com/en/technical-article/000012595)

So, can or can't you use versioning with a file geodatabase?


texts: Finding routes instead of straight line in Network Analyst O/D cost matrix?

texts:
I have 53 locations of origin-destination lat and long and a shapefile of the road network of the study region. I would like to find the shapefile of all O/D routes. I tried with network analyst, O/D cost matrix. But there I got an only straight line from one point to another. But instead of a straight line, I need routes as like it shows on “new route” in network analyst.

Is this possible in ArcMap?


texts: How to import a map consisting of pictures

texts:
I want to built some sort of Fantasy Map with Quantum GIS.
The whole map is built out of 128x128 single pictures, 16384 in total. It should be a flat map.

How do I import these pictures and align them in a grid into QGIS?


texts: ArcGIS JS API Edit Toolbar permits MOVE but not EDIT_VERTICES or ROTATE - JavaScript error thrown

texts:
I'm putting together an ArcGIS (v10.1) JS API (v3.2) application and I've hit a snag in drawing / editing functionality.

Users can draw a new geometry or edit an existing one. I'm using the draw and edit toolbars to achieve this, but attempting to activate the edit toolbar is producing some strange errors and I don't know where to start debugging.

This function works fine for moving a Graphic around on the map:

editGraphic: function(graphic) {

    this.editToolbar.activate(
        esri.toolbars.Edit.MOVE,
        graphic,
        {allowAddVertices: true, allowDeleteVertices: true} // used for EDIT_VERTICES action
    );
}

However, if I change the action to esri.toolbars.Edit.EDIT_VERTICES, esri.toolbars.Edit.ROTATE, or any combination I get

Uncaught TypeError: Cannot call method 'add' of null _VertexMover.js:19

I've managed to do some digging (it's not easy as ESRI has everything uglified and Chrome's developer tools crash when I try to pretty print the API to support tracing the error. It seems the null object in question is a property called _scratchGL, which I assume should be the Graphics Layer, but is null (note it's not undefined).

The edit toolbar is defined as

this.editToolbar = new esri.toolbars.Edit(this.map)

and obviously the map is what it should be.

I discovered while debugging other errors that the Graphic should be passed to my edit function via a Graphics Layer event, so the graphic variable passed to my function is sourced in this way (I think this is necessary to ensure key properties are set on Graphic, such as the Graphics Layer it belongs to).

Unfortunately due to the size and many files in my application it's just not possible to show a useful sub-section of the code and I can't provide the whole lot.

The fact that I can use the MOVE action tells me that I'm doing things correctly, so why can I not edit vertices or rotate?

Fundamentally I'm not doing anything different to this example, which uses the same version of the API. However it is perhaps significant that if I add the following line of code it does not respond to clicks, even when all other map click handlers are disabled

dojo.connect(this.map.graphics, "onClick", function(evt){
    debugger;
});

Has anyone had a similar experience? I've Googled this quite a bit but to no useful outcome. I don't even know where to start on the problem. Any thoughts very much appreciated.


texts:
I am trying to hyperlink from MS Access to ArcMap to view specific features.  Within MS Access, I have 1400+ lines catalogued.  I would like to click a button and view the line in ArcMap.

Any ideas on how to do this?


texts:
I have some waypoints, and I need to input them into Google Earth.

How can I convert data from GPS to KML file?


texts: Geocoding addresses with list of coordinates

texts:
I have a list of addresses in Bavaria I want to geocode (about 20.000 addresses) and use the coordinates afterwards in QGIS for analyzing.

As I don´t want to do it with google API or similar (because of limited number of addressed per day, data protection etc.) I´m looking for other possibilities.

I do have a file of coordinates of every house in Bavaria - so it wold be theoretical possible to match the addresses with this file. The problem is, that the file with the coordinates is quite big (450MB, 3.500.000 datapoints). When I´m loading it into QGIS it´s nearly impossible to edit it...

Is there any idea how I can deal with this topic?


texts: Terrain shadow masking in Landsat 8 TOA image

texts: I am using hillShade function to mask the terrain shadow but its not give right output. hilshadow function also parameter azimuth angle and zenith angle is not define in Landsat * metadata.


texts: OpenLayers FramedCloud has transparent background

texts:
I am creating a FrameCloud popup instance and adding to the map using the following code:

  var popup = new OpenLayers.Popup.FramedCloud("popup",
                point,
                null,
                '<div> test context </div>',
                null, true);

            map.addPopup(popup);

Popup is displayed at the correct location but with a transparent background probably because I am using a local copy of OpenLayers.js instead of the public version.  For local deployment, where do I put the resources found under the img folder required by OpenLayers?


texts: Leaflet How To Update User Position Marker Real Time

texts:
I am trying to update user position in leaflet. Like when the user walks with their phone their location marker will move too based on location data just like Google Maps.

Right now I'm just putting a marker on their initial position

    this.map.locate({
  setView: true,
  maxZoom: 120
}).on("locationfound", e => {

  leaflet.marker([e.latitude, e.longitude]).bindPopup("YOU ARE HERE!").addTo(this.map);

  console.log("lokasyon bulundu");
}).on("locationerror", error => {

  console.log("lokasyon bulunamadi");
});

Tried update() method but couldn't make it work. I guess I should take user location data every second and if it is different then draw a new marker and remove the old one?

Is this an efficient way?

edit: tried this but not working

this.map.locate({
        setView: true,
        maxZoom: 120,
        watch:true,
        enableHighAccuracy:true
      }).on("locationfound", e => {
          if (!usermarker) {

            if(this.profileData.avatar == "https://i.hizliresim.com/zJJ239.png"){
              usermarker = new L.marker(e.latlng,{icon : ayi}).addTo(this.map);
            }else if(this.profileData.avatar == "https://i.hizliresim.com/mJJrkP.png"){
              usermarker = new L.marker(e.latlng,{icon : ironman}).addTo(this.map);
            }else if(this.profileData.avatar == "https://i.hizliresim.com/vJJQpp.png"){
              usermarker = new L.marker(e.latlng,{icon : dino}).addTo(this.map);
            }else if(this.profileData.avatar == "https://i.hizliresim.com/zJJ2B9.png"){
              usermarker = new L.marker(e.latlng,{icon : petyr}).addTo(this.map);
            }
          } else if(this.profileData.avatar == "https://i.hizliresim.com/zJJ239.png") {
              usermarker.setLatLng(e.latlng);
          }
      }).on("locationerror", error => {
          if (usermarker) {
              map.removeLayer(usermarker);
              usermarker = undefined;
          }
      });


texts: Do I need to generate a JSON request to send data to Waze when using Road Closures (ArcGIS Solutions for Local Government)?

texts:
We are new to the Waze for Cities program. Currently, I am trying to get information regarding how to submit road closure data to Waze using Road Closure solution. I read all the documentation for this solution, as well as the guidelines provided by Waze for this task. Being an Esri shop, we want to use this tool rather than Waze Map Editor since WME will not work for our workflow.

Per Esri’s documentation for this solution, in order to share our road closure data, we must create a JSON request from the feature layer. I was under the impression that deploying this tool and configuring the Organization ID, etc. will handle all these things.

Can someone elaborate on this topic?

See the following two links:

https://solutions.arcgis.com/local-government/help/road-closures/workflows/share-waze/

https://developers.google.com/waze/data-feed/overview


texts: QGIS - How to avoid -2147483648 value from imported CSV?

texts:
I am attempting to join a spreadsheet containing all the CIA Factbook Country Comparison Data (many columns) to the existing Natural Earth world countries shapefile.  I followd the tutorial here, but a couple of things occurred:

1)  Several of bits of data were changed to -2147483648

2)  The imported field lengths all show as "0" in the properties.

I am not trained in GIS and I have never worked with databases.  I am simply trying to combine this data and shapefile, so that my students will be able to graphically manipulate and analyze the information in a new Global Studies course.

I've tried taking the spreadsheet (from Excel) and putting it through Access and then exporting to a dbf file.  I have set all the field lengths to 100 (and even tried 50), but I get a "field will not fit in record" error.  I even tried truncating the column headings to 10 (thinking that might have been the problem, based on internet searches), but it didn't help.

As Per Comment:

Here is a link to a version of the spreadsheet with truncated headings.

Here is a picture of the corrupt data.
https:// docs . google . com/file/d/0BzHj6AzbbxcINy1jTGRPTDh1bFU/edit?usp=sharing


texts: How to Dynamically refresh / reload a KML layer in OpenLayers

texts:
I have previously asked this question to no avail so I thought putting this up here would be a good idea.

Here is an example on:

How to Refresh / Reload a KML layer in OpenLayers. Dynamic KML Layer. See my answer below.

TLDR: See my answer below.


texts: Python GDAL split polyline by intersection

texts:
I want to process some vector flowline file. After I used the Union function to combine all the geometry into one single MultiLineString.
newGeometry = None
lID =0
for pFeature_in in pLayer_in:
    pGeometry_in = pFeature_in.GetGeometryRef()
    if newGeometry is None:
       newGeometry = pGeometry_in.Clone()
    else:
       newGeometry = newGeometry.Union(pGeometry_in)

Then followed by the ogr.ForceToLineString function to split it into LineString.
lID =0
for pFeature_in in pLayer_in:
    pGeometry_in = pFeature_in.GetGeometryRef()
    aLine = ogr.ForceToLineString(pGeometry_in)
    for Line in aLine:
        pFeature_out.SetGeometry(Line)
        pFeature_out.SetField("id", lID)

However the result is not what I expected. For example, the MultiLineString split it into 2 parts as illustrated on the left.

What I wanted is something like in ArcMap (link below). Or as illustrated on the above right.
https://desktop.arcgis.com/en/arcmap/10.3/manage-data/editing-existing-features/splitting-lines-at-intersections.htm
I want to do this using GDAL Python API only. Is there any method I can try?


texts: How do I download tracks from Garmin GPSmap 62 using GPS utility?

texts: I think I have to open files from windows file manager and then save these, rather than the autoconnect facility available between other Garmin devices and GPS utility.. Is this correct or is there a way to get it to open the GPS transfer window automically on connection with this device model as this has the tick options for tracks download too? If I have to go via windows file manager, how do I differentiate tracks from waypoints and is there an easier way please?


texts: When I run r.resample to crop a map by using a vector and a mask, the resulting map has the same shape as the vector that I used but does not replicate (exactly) the portion of the raster map that I used as input in the r.resample. It produced a map with altered elevation values that is different from the raster map I used as input. I read that r.resample just "crops" the raster that is its input and does not alter it. I do not know why r.resample alters the output map


texts: How to choose suitable pyramid levels and tile size?

texts: I have a big tiff file and i want to create tiles with gdal_retile. However  I am still concerned about the pyramids levels and the tiles' size. how can I choose suitable pyramids levels (for example 5, 6 or 18 zoom level) and the pixel size for each of my tiles?


texts: arcpy.da.InsertCursor generating empty polygons?

texts:
I am using this script to copy some features from an input featureclass into an output featureclass. This works for points but surprisingly not for polygons. For polygons it is generating features with null geometry (Shape_Length and Shape_Area equal to 0), while I can confirm they are not null in the input dataset. What could be causing this issue?

out_gdb = arcpy.env.scratchGDB
desc = arcpy.Describe(input_shapefile)
geom_type = desc.shapeType
sr = desc.spatialReference
out_fc = arcpy.CreateFeatureclass_management(out_gdb, os.path.basename(input_shapefile) + "_Export", geom_type, input_shapefile, spatial_reference=sr)

id_field = desc.OIDFieldName
where_clause = """{0} IN ({1})""".format(arcpy.AddFieldDelimiters(input_shapefile, id_field), ','.join([str(id) for id in feat_ids]))
with arcpy.da.SearchCursor(input_shapefile, ['*'], where_clause) as sCur:
    with arcpy.da.InsertCursor(out_fc, ['*']) as iCur:
        for row in sCur:
            iCur.insertRow(row)


texts: How to format values using SQL in CARTO?

texts:
I am trying to make sense of how to format data values for a popup.

I have values that are reading $890000, and I want them to read $890,000.
How would I format my SQL statement?

More generally, is there documentation on how SQL syntax works in Carto? (I see this symbol | in between statements, and I am trying to understand what that means)


texts: How to assess quality of the TSP algorithm?

texts:
I'm trying to develop my own algorithm for solving Travelling Salesman Problem (TSP)
I tested it (in its current state) on the "att48" instance of the TSPLIB and got following results:

As we can see more than 3/4 of results are within 110% of the optimal route length. But in scientific literature they report for over 20 decades that their algorithms solve like 99% of the TSPLIB instances to 1% of the optimal distances (though where are their GIS implementations?!).  So I wonder if there is for example a commonly acceptable threshold for the algorithm output to determinate whether it is garbage or can be used in real life? Or there are exists other means of TSP solver assessment?


texts: Locating land title technical description on Google Maps

texts:
I am planning to buy a certain property but I'm too far away from where it's located to check it personally.
The seller sends me a technical description of the property and I'm trying to locate it on google maps. he also said its somewhere around here https://www.google.com/maps/place/7%C2%B047'47.1%22N+126%C2%B001'40.9%22E/@7.7964283,126.0258283,17z/data=!3m1!4b1!4m9!1m2!2m1!1s-91.2525!3m5!1s0x0:0x0!7e2!8m2!3d7.7964231!4d126.0280167
Unfortunately, I do not know how to decode the technical description to convert into latitude and longitude coordinates that I can use to locate it on Google Maps and I'm not even sure if its possible.
Can anybody advise if the details on the image below can be used on locating the area on Google Maps and if there's any tools or formula I can use.


texts: what is the difference between ol.Map and ol.PluggableMap in openlayers

texts:
I can see 2 kinds of map in openlayers , default map class and ol.PluggableMap .

var map = new ol.Map({
    target: 'm_gmap_1',
    controls: []})

and pluggableMap = new ol.PluggableMap({
 target: 'm_gmap_1',
        controls: []})
}),

could anyone please tell me difference


texts:
I have 4 shapefiles that I need to compare spatially, to highlight inconsistencies between them in ArcGIS. I have used the Feature Compare tool so far, but I'm looking for a faster way to compare the 4 shapefiles to one another (10 comparisons).

I don't need to compare the attribution, fields, table rows, spatial refs - purely the shape.


texts: Converting a slightly warped polygon lattice with irregular edges to a raster

texts:
I have a problem which has been frustrating me for a while. I have a lattice of polygons which is slightly warped due to unknown CRS transformations & distortions, enough so that the side lengths vary from about +/- 15m. There are also holes inside and there are irregular edges. This pic shows a subset of the grid:

I need to convert this into a numpy array so that I can apply a moving window function onto it.
So far I have tried:

Finding the original projection so that all the edge length discrepancies are negligible - no luck

Creating another point lattice on top of it, hoping that despite the distortions, there would still be a 1:1 parity for a point to a square - no luck again, the lattice is too big and the points eventually get out of sync and skip a square

I feel like I am out of ideas on this, but I really need to get this into a raster/numpy array. The only limitation is not to use ArcGIS because I don't have a license.


texts: Representing overlapping lines in ArcGIS Desktop?

texts:
I have lots of lines (in one feature class) which share the same location but I want to represent them as lines that are next to each other because they have different properties (different OWNERS).

So, my first try was transforming them in "Cartographic Line Symbol' -> 'Line Properties' set my offset different for each one. Which is fine except:

As you can see when I choose to represent the lines according to their owner (color= owner). The offset works great, but I need all the lines to be connected and sink in a junction. Something like this:

So I tought the solution is to create a representation, but not sure how to use a text field (OWNERS) in order to create those parallel lines (the equivalent of Symbology->Categories-> Unique Values-> Value field: OWNER). I know I should use the offset geometric effect. but I'm not sure if this is the solution and how should I do that.

I am using ArcGIS Desktop 10.1.


texts: QGIS very slow and stops when increasing points size / number

texts:
I used the "graduated" style option to represent data by year.

Then for each year I used this method with a custom function to increase point size according to the number of points at the same location.
increasing marker...

It works well but QGIS takes more  than 30 minutes to display and the same time to save the map using composer. It often just stops.

Is there another way, faster, to get this result?

I'm using QGIS 2.12.

Here a part of what I would like to obtain (using increasing markers size...)

Here what I obtained with csk suggestion : new field creation, convex hull and centroid extraction

something is probably wrong.

  Finally, I used this method which allow to draw points with size relative to the frequency at one location. It is very fast and uses both fied calculator as suggested, but a categorized symbology based on the new field.
  Increasing marker size based on frequency...


texts: Python: how to set a different output folder

texts:
I want to transform some vectors to rasters in my folder but I have difficulties setting the output folder. The following code only allows me to output to the original database. I hope to output all results to the same folder instead of in their original database.

import arcpy
import os

workspace = "D:\Jiawei default download"
feature_classes = []
walk = arcpy.da.Walk(workspace, datatype="FeatureClass", type="Polygon")
for dirpath, dirnames, filenames in walk:
    if "Subbasin" in filenames:
        filenames.remove('Subbasin')
    for filename in filenames:
        feature_classes.append(os.path.join(dirpath, filename))

print feature_classes

for item in feature_classes[98:]:
   inFeatures = item
   valField = "wtdepaprjunmin"
   outRaster = item+"_r"
   print "processing "+item
# Execute PolygonToRaster
   arcpy.PolygonToRaster_conversion(inFeatures, valField, outRaster)


texts: Selecting trips that their pickups and dropoffs are located in the same polygon in ArcGIS

texts:
I have point features indicating the taxis' trip data for pick-ups and drop-offs like the following:

[pickup_longitude, pickup_latitude, dropoff_longitude, dropoff_latitude, #passengers]

I want to select only the rows (trips) that their both pick-ups and drop-offs are locate in the background (Polygon) layer.

Any suggestions?


texts:
I just try to figure out how to query all ways within a radius of let's say 1km from a defined point. Here is an example of what I mean:

I've already read about overpass api, GeoTools and openlayers, and it all appears to be doing what I want it to do. But practically I still haven't figured out how to do it. I want to build an application using Java. So it would be great having a java-solution for querying the required data.


texts: QGIS 2.0 Atlas Generation: Can I force the selected feature to be the last one rendered

texts:
I have a layer with a number of features that represent zones which share some boundaries with others.  I am using Atlas generator to produce a set of maps, one for each zone extent.  The zones are rendered in different colours and I want the current feature rendered last so it is on top.

That is in the red zone map I want the outline of the red zone (rendered in red ;) drawn last so that all the red zone is red and not blue where the blue and red share a boundary.

Alternatively can I suppress the other features altogether?


texts: ArcGIS Server 10 and Desktop 9.3 interoperability?

texts:
I want to install ArcGIS Server (AGS) 10 but our users only have ArcGIS Desktop 9.3.1.

So does Esri support:

Access/use AGS services from 10 in 9.3.1?
Manage (create services etc) AGS 10 from ArcCatalog 9.3.1?

I know you can use the web manager but our users are used to managing AGS from desktop.


texts:
How can I change the color (randomly or iterate through a specific array) of a feature that I draw on the map?

This is my code:

// marker layer
Msource = new ol.source.Vector();

markLayer = new ol.layer.Vector({
  source: Msource,
  style: new ol.style.Style({
    image: new ol.style.Icon({
      opacity: 0.95,
      src: 'http://www..../images/mapplot.png',
     color: "red"
    })
  })
});

I have a button that when I click on it allows me to draw that marker with this code:

var mark;
var counter = "true";

function addMark(Type) {

  counter = "true";

  mark = new ol.interaction.Draw({
    source: Msource,
    type: Type
  });

  // limit the marker to 4
  if (Msource.getFeatures().length < 4) {

    map.addInteraction(mark);

    // occurs when you finish to draw the current element
    mark.on("drawend", function(){
      counter = "true";
      drawingMarker();
    });

    // occurs just after you finish to draw the current element
    markLayer.on("change", function(){
      map.removeInteraction(mark);

      if (counter == "true") {
        counter = "false";
        var ind = Msource.getFeatures().length - 1;
        Msource.getFeatures()[ind].setId(MarkId - 1);
      }

    });

  } else {

    map.removeInteraction(mark);

    // show max marker message
    $(".maxmarkers").css("display", "inline");

  }

} // end addDraw

$("#Marker").click(function(e) {
  e.preventDefault();
  addMark("Point");
});

I use some other function like remove function and drag feature, for this reason, I assign an incremented ID.

How can I change the color of the marker randomly or through an array (the max marker are 4)?

Here a screenshot of how it looks at the moment, the marker is not red because I'm using another image at the moment but I have another (always png) that change color based on the color in the layer.


texts: Changing from portrait to landscape layout?

texts:
I am trying to switch to from a portrait to landscape layout. I've already switched up the buttons in page and print set up and for some reason, the print layout icon shows my page still having portrait features in a non-completely filled landscape icon.

I'm a graduate student in urban planning who still has his GIS training wheels on.


texts: AttributeError with unicode object with data frame in python script

texts:
I'm running a python script from arccatalog and it works, however, I am trying to add layers to an mxd and need to declare the data frame.  I keep getting this error message.

type 'exceptions.AttributeError': 'unicode' object has no attribute '_arc_object'
Failed to execute (StepByStep)

Selection of my code is below.

# Import arcpy module
import arcpy
import sys

# Licenses
arcpy.CheckOutExtension("3D")
arcpy.CheckOutExtension("spatial")
arcpy.OverwriteOutput = True

# Script arguments
arcpy.env.extent = "E:\\School_Test\\SchoolTest.gdb\\Extent"
arcpy.env.cellSize = "3"

mxd = arcpy.GetParameterAsText(0)
arcpy.env.scratchWorkspace = arcpy.GetParameterAsText(1)
arcpy.env.workspace = arcpy.GetParameterAsText(2)
spRef = arcpy.GetParameterAsText(3)
Survey_Data = arcpy.GetParameterAsText(4)
Survey_X = arcpy.GetParameterAsText(5)
Survey_Y = arcpy.GetParameterAsText(6)
Survey_Z = arcpy.GetParameterAsText(7)
Sample_Data = arcpy.GetParameterAsText(8)
Sample_X = arcpy.GetParameterAsText(9)
Sample_Y = arcpy.GetParameterAsText(10)
Selection_Criteria = arcpy.GetParameterAsText(11)
Site_Grid = arcpy.GetParameterAsText(12)

df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]

Below this I declare variables then geoprocessing.

Any suggestions?


texts: Sentinel Cloud-free Collection Google Earth Engine Code Editor

texts:
I am trying to create and map an image collection (not image or mosaic if that is even possible), where QA60 defines the Cloud-mask. I have written the code below - however, it seems the Jan2016 images do not correspond the cloud mask, even though the pixel inspector shows the same image time stamp for all layers. Hence, "NoCLouds" layer contains many pixels with clouds and has many other without masked. Maybe my mask is wrong?

var Jan2016 = ee.ImageCollection('COPERNICUS/S2')
      .filterBounds(NSW)
      .filterDate('2016-01-01', '2016-01-30');

var trueColor = {bands: ['B4', 'B3', 'B2'], min: 0, max: 3000};
var falseColor= {bands: ['B8', 'B3', 'B4'], min: 0, max: 3000};
//Define the CLoud layer (here: QA60 is MSI2's quality mask)
var Clouds = {bands: ['QA60']};

//Add the cloud mask as layer; PROBLEM: SEEMS QA60 is taken from different images every time..
//Clouds is just a band, do i need to specify the threshold?
Map.addLayer(Jan2016, Clouds, "CloudsJan16");

// Mask clouds
var noclouds = Jan2016.map(function(img) {
              var mask =
img.select(['QA60']).neq(11);
//.neq(xx) doesn't seem to make a difference
                   return img.updateMask(mask);

});

//Add the layer/imagery to the map with variable, display type, and name
Map.addLayer(noclouds, trueColor, "NoClouds");
Map.addLayer(Jan2016, falseColor, "Jan2016false");


texts: Access to WMS from ArcMap with extra parameters

texts:
I'm trying to access AIRS WMS from ArcMap with additional time parameter (&TIME=2012-07-01) to see this summer's CO concentration. But the server returns a response with standard parameters (last month).

How to pass this parameters in the ArcMap WMS-connection correctly?


texts: Exposing (PostGIS) spatial operations as web services?

texts:
How can (PostGIS) spatial operations be exposed as web services?

e.g. if we wanted a web service end point that would return a data set with the top 5 schools nearest to a location

NOTE: can I make it clear that this is NOT for presentation on a map. Rather it is for use in a server-side workflow, where next stages in the workflow will be using the list of schools for additional actions.

I could write a .NET WCF web service, and maybe somehow call the PostGIS system, but this seems a bit overkill. And I seriously can't believe we're the first place that wants to do this.


texts: Adding bbox of my map with Expression Builder into text field

texts:
I was commissioned to create a simple print layout. The basic-layout is very simple, it just contains one map with OopenStreetMap-layer.
I want to add the Xmin, Xmax, Ymin and Ymax of this map (like all the values in the extention-tab) as text field. The text field should then display the coordinates of the map's corners, and should automatically adjust when I zoom in or out, so copy&paste is not an option.


texts: Geo-hash finding nearest neighbour with massively variable distance to actual nearest neighbour

texts:
I have a series of points in lat-long space, ranging from having their nearest neighbour very close to 1000s of km away. Say I do a geo-hash of these to a high precision, my search of nearest neighbouring squares must be of a lower or equal precision.

How can I find the closest point/s efficiently when I have no guarantee if there will be any neighbouring hashes given the precision of my search grid?

If I set the grid too high I include too many, If I set it too low I don't find any.  My set can contain both these scenarios simultaneously depending on which point you look at.

Is there a preferred way to find the closest point/s when we don't know if the closest point is right next to the other or 1000s of km away?


texts: A way to log the output from the Msys terminal in OSGEO4W?

texts:
Is there a way to log all the text output from commands in the Msys terminal to a text file when using OSGEO4W in Windows? I'm using GDAL commands and specifically wish to record any error messages that come up.

Any help much appreciated!


texts: Getting values from Qt widgets and using them for a buffer

texts: I am writing a simple plugin that finds buffer. My gui has 2 combo box and 1 Line edit. The first combo box will have a drop down of values  from column 'States' and 2nd combo will have a drop down of values from column 'Cities'. Note that the Cities will be filtered in the combo box depending on the states selected. And 3rd Lineedit gets a distance from the user. As a result, I want buffer for the cities (from the 2nd combo box) with the user specified 'distance value' given in the lineedit box.I tried QgsGeometryAnalyzer().buffer() function in QGIS API. But the first argument is a layer for the above mentioned function. Instead i want my gui to take value from the city combo and lineedit and find buffer. How to accomplish. Sorry for the lengthy post.


texts: Writing ArcMap Label Expression in VBscript?

texts:
I have to columns, pipe material and pipe size, I only want to label pipes with a size greater than 2"

I am trying to do this but keeps kicking back and error, can anyone assist in what im doing wrong?

Function FindLabel ( [PIPE_MATERIAL] , [PIPE_INTERNAL_DIAMETER] )
  if ( [PIPE_INTERNAL_DIAMETER] > 2") then
   FindLabel = [PIPE_MATERIAL]
  end if
End Function


texts: Automatic calculation in one attribute table based on values in another attribute table using python

texts:
I am trying to fill the fields of one gdb table based on some statistics over the attributes of another shape file. As it was not possible in ARCgis directly, I am trying to use python coe for this case.

I have table A where:

Work_done   Length
  1
  50
  100

I would like to say that fill the legth field with sum of the Shape_Length in table B where "work_Done" field is equal another feild in table B.

the following code is what I am thinking and I want to use it in the field_calculator but I got failed. I am not really pro in python therfore I would be really happy if sombody could guide me.

  import arcpy

  from arcpy import env

  # Set the current workspace
  env.workspace = "C:/Python27/ArcGIS10.1"

  table = "Corriodr_stat.dbf"
  ft = "Length"
  fc = "Corridor_test.shp"
  f1, f2 = "Corridor_S", "SHAPE_Leng"

  for row1 in sorted(arcpy.da.SearchCursor(fc, [f1, f2])):
     for row2 in sorted(arcpy.da.UpdateCursor(fc, [ft])):
        if fc.f1 <= 1:
           table.row2 = getvalueField(sum row1.f2)
        elif (fc.f1 > 1 and fc.f1 <= 60)
           table.row2 = getvalueField(sum row1.f2)
        elif (fc.f1 > 60 and fc.f1 <= 100):
           table.row2 = getvalueField(sum row1.f2)


texts:
I have a pipe network that is a imported CAD file converted to lines showing complete runs of pipe in a system. I also have a Access database imported to ArcGIS set up as a relate to my Pipe line items. There are 3 access tables:
Systems
pipes(Subsystems of the above)
pipe sections (Subsystems of the pipes)

currently when you click identify on each pipe I can see the related data so can see what system the pipe is in, all the pipes and pipe sections. I have used the relate option as there is no XY data in Access

I would like to create a route layer so that all the pipe sections from the Access table are visible in the map as line items. I think I can do this using a route event. The pipe sections have a begin and end point in the table. However when I use the Make Route Event Tool I use the event input table as the Access table but I get a 000840 "The Value is not a Route Measure Event Properties".

Would someone be able to give some guidance? Basically all I want to do is display Access data as line items on the map, but the only spatial data I have is the imported CAD drawing.


texts: How to know what spectrum image layers are in eCognition?

texts:
I'm learning to use eCognition (8.1) and my teacher has provided me with some example tif files to segment and classify. The tif files have multiple layers, each of which are supposed to represent a light spectrum (Red, Green, Near-infared, etc). The problem is that I'm not always given descriptions of what spectrum each layer is supposed to be.

My question is, is it possible tell what spectrum a layer is supposed to represent?


texts: It is possible to add A* to the pgrouting plug-in?

texts:
I am using pgrouting layer plug-in as described in this post:
http://underdark.wordpress.com/2011/12/18/osm2po-part-2-pgrouting-on-osm-the-easy-way/

I am now able to calculate the shortest path using Dijkstra algorithm. I would like to know if it is possible to add to the pgrouting plug-in the A* shortest path algorithm.

Thank you.
Selini


texts: How do I change the targeted .NET 4.0 Framework to version 3.5 in an existing VS 2010 EXPRESS project?

texts:
I am upgrading from ArcGIS desktop 10.0 to 10.1 and I have a bunch of addins developed in VS 2008 Express using ArcObjects 10.0.  I would like to upgrade everything to 10.1 using VS 2010 Express.  I understand that for ArcGIS Desktop .NET Framework 3.5 Service Pack 1 is still required.

I converted my first existing addin to 10.1 in VS 2010 Express but it seems to be targeting .Net 4.0. I only found instructions on changing the target version in full version of VS but I can't find this feature in the Express edition.  Can someone shed some light on this?

EDIT:  I am adding a screenshot from Project -> Project Properties -> Application to show where I would expect to change the Target Framework but I don't see where it could be changed.

EDIT 2: I found an option to change Target Framework (All Configurations) under Project -> Project Properties -> Compile -> Advanced Compile Options -> Target Framework (All Configurations)

Can someone confirm that his is where I change the target framework in the 2010 Express edition?


texts: Is ESRI metadata standard compatible with  GeoNetwork metadata standard? If yes how do I update the Geonetwork metadata using Arc-Catalogue 10 Metadata xml?


texts: I am looking for shapefiles for Mumbai ward wise map. This is required for my research work on disease mapping. Please could anyone share any link for the shapefiles.


texts: Using a web map to identify and access data

texts:
I am trying to making a webpage where the user pans and zooms on a map, and based on the location and zoom level, some data is displayed on the webpage (drawn from another source). The data that will be displayed is not spatial data, and it will not be shown on the map. I thought I could have a database for each zoom level, and then when a call to the database is made, it returns the data associated with that location and zoom level.

I saw an approach on the google earth documentation regarding regions and this related SE question. However, I was hoping to use Google maps for this.

The data being returned for each area is just one number. For example, say I wanted to see the number of people in a certain area, it would show that value on the webpage. The first iteration of this I was hoping to do for a city (London), and then see if there were any performance issues.

Is this a reasonable approach? Are there any better ways of doing this, or things that I should be aware of?


texts: Open Source Tools for Swept-Path Analysis?

texts: Before I spend time writing something, does anybody know of any open source tools to perform swept-path analysis (preferably suitable to run on Windows and a Python API would be a bonus)?  I pretty sure I can figure it out, but I'd rather not re-invent the wheel if I don't have to.


texts: Why do I get an "Type 'IPoint' is not defined" error in VB.NET

texts: I am writing an add-in for ArcMap 10. I am trying to do Dim clickedPoint as IPoint in VB.NET, but I get "Type 'IPoint' is not defined" error. Do I have to import a class or how do I make this work?


texts: Populating blank columns with polygon information

texts:
I have two layers in QGIS 2.8.2: a point layer and a polygon layer. Points fall within different polygons. Polygons have identifying features (ID, Name). Point layer has a blank column in the attribute table. I would like to populate the blank column with information from the polygon layer (Name). I tried relating the two layers (as described here), but that only allows me to see the relation if I click on a point and does not actually populate the blank column.

Does anyone know how to do this?


texts: I want to know how to keep a layer always on top of other layers!  After adding a vector layer ( QgisInterface->addVectorLayer ), I want that layer to always be displayed on top of layers added later. Can anybody help me with this ?


texts: how to create custom widget in mapguide fusion template?

texts: I am using mapguide maestro 5.0.1. I want to add custom fusion widget which have option to search layer in multiple ways. I am not able to find any tutorial to add custom widget useful. can you please suggest any tutorial which explain  everything in detail. I have working module of this option in ajaxviewer can I use it in fusion.


texts: Processing multi-band raster in qgis using python script?

texts:
Is there a way to process (for example by using raster calculator or r.null) a multi-band raster?

When I try to use raster calculator in QGIS 2.18.3 on multi-band raster the output is a raster that contains only the first band, and I would like to get a raster with the same number of bands as the input.

I would like to multiple every band by 5. When I use raster calculator the output is a single-band raster (just the first band) multiple by 5.
Another thing I'm try to do is to change all "0" value to null for every band. SAGA mosaic tool is able to set null but it doesn't work on multiband raster, and GDAL mosaic doesn't have that option. When I use the "r.null" tool it only sets null values to the first band, which is the output.

It would be great if you can help me using python script.


texts: How to split polygon features using an overlaid polygon layer in QGIS?

texts:
I have a polygon layer (pictured below) that I made by vectorizing a clip from the USDA Cropland Data Layer. The low resolution of the USDA layer causes fields that are separated by narrow roads to "bleed" into each other and be rendered as a single feature following vectorization.

For analysis purposes, I need separate fields to be rendered as separate features. So, I downloaded a vector roads layer and subtracted that from the crop layer, carving up the layer along the roads. I expected this to split bisected fields into separate features, but it did not, as shown below (only one side was selected, but both light up).

Manually splitting features one at a time is not an option. How can I use a geoprocessing approach to cut my crop layer along roads such that bisected features are split into separate features in the output? I'm using QGIS 2.8.


texts: how to replace GTileLayer in google maps API v3

texts:
I need to port code of one application written in Google Mapa API v.2 to API v.3. There is several layers taken via TMS, that are displayed using GTileLayer class. It is as simple as:

var tilelayer_tematyczne = new GTileLayer(null, null, null, {
    tileUrlTemplate: 'http://domain/geoserver/gwc/service/gmaps?layers=layer&zoom={Z}&x={X}&y={Y}&format=image/png',
    isPng:true,
    opacity:1
});

tilesTematyczne = new GTileLayerOverlay(tilelayer_tematyczne);
map.addOverlay(tilesTematyczne);

I do not see any similar class in API v3. How do you cope with that problem? How to display TMS on top of Google Maps?


texts: pgAdmin 4: create view without defining schema

texts:
I have a database containing the official cadastral surveying of hundreds of counties. For every county I have created a new schema named state_zipcode_countyname. As all my db entries have the same structure, I would like to create distinct views using the underlying relationships.
For example, the surfaces' type definition is stored in an external table "surftype". Thus, over the following code I can create a new view to use:
SELECT p.fid,
    p.geometry,
    a.type
   FROM state1_12345_mycounty.surfaces p,
    state1_12345_mycounty.surftype a
  WHERE (a.fid = p.atype);

However, as I have hundreds of schemas and multiple views per schema, I would like to omit defining "state1_12345_mycounty" in every view. Instead, I'd like to only browse the schema in which the view is stored, so that I can copy-paste my views quicker and easier.


texts: How can i convert a raster from continuous to discrete?

texts:
I have a tiff that is 'invalid' for a lot of tools and will not let me view the attribute table. I think this is because it is "continuous" rather than "discrete".

Does anybody know how to convert it or make arcgis treat it as a discreet raster?


texts: I want to orient point arrow symbols with lines segments in a hydro network, as the line symbol "ArrowRight Middle" does

texts: I am working in ArcMap 10.1. I have to represent the flow direction of a line Feature Class in a FGDB and to convert it in KML format. I have used the "Arrow Right Middle" and it works fine, as my hydro network was well digitized. However, that symbology wont translate into KML. Point symbology, on the other hand, should translate properly. Therefore, I have created points on the segments of my Hydro layer. I am looking for a way to orient arrow symbols on those points in the direction of the corresponding lines.


texts: I wanted to play around with QGIS 3 release candidate (2.99) and after installing on Windows, it looks like there is no version of QGIS that doesn't include GRASS.  Is this correct?


texts: Getting angle of point generated from DEM in Raster using Field Calculator in ArcGIS Desktop?

texts:
I am trying to calculate the angle of some specific points generated from flow direction in ArcMap 10.2. I converted the DEM to flow direction and then to points. I am trying to convert the grid_code of the generated points into specific angles with a certain condition. I tried using the below Python code in the Field Calculator but it gives an error as shown in the image attached.

Can someone explain how to do this right?

    ##########################
def Reclass ([grid_code]):
if ([grid_code] == 64):
                        return 0
            elif ([grid_code] == 128) :
                        return 45
            elif ([grid_code] == 1) :
                        return 90
            elif ([grid_code] == 2) :
                        return 135
            elif ([grid_code] == 4) :
                        return 180
            elif ([grid_code] == 8) :
                        return 225
            elif ([grid_code] == 16) :
                        return 270
            elif ([grid_code] == 32) :
                        return 315
  Reclass(![grid_code]!)
###########################

Here is how the attribute table looks like


texts: Merge overlapping polylines to new polyline layer

texts:
I am new to QGIS.

I have an underlying polyline map layer and another polyline layer representing a drive I took. Naturally, the drive data overlaps the map and I would like to create a new layer showing where the polylines from the two layers overlap.

I have previously used to the 'MergeLines' plugin, however, it doesn't seem to take two layers into account?


texts: How to transform KML from lon-lat to UTM (E-N), using Python?

texts:
I have a lot of KML files set as lon-lat (geographic coordinates) and want to set them as UTM (E-N) and WGS84 with Python (using arcpy, ogr, or gdal)

Does anyone knows how to do this?


texts: writeRaster() not writing datum information

texts:
I am trying to reproject a raster to the USGS version of the Albers Equal Area Conic projection. Following this post, which talks about projecting vectors by adding the +datum=NAD83 and writing it out, I did the same for the raster and wrote it out using writeRaster().

However, the resulting raster still has no NAD83 datum when viewed in Arc or QGIS or when read back into R (i.e. the +datum=NAD83 doe snot appear in the projection string). How do I project the raster to the USGS Albers Equal Area Conic projection with the NAD83 datum and write the raster out?

Also, I am writing out the output in tif format, which I don't think can store projection information. Should I be writing out the raster in another format that can store projection information? Which one?


texts: gdalwarp to geographic coordinate system

texts:
I'm getting the folllowing Error when trying to re-project a raster from NAD_1983_Albers to GCS_North_American_1983.  I used the proj4 defenition from going to Properties in QGIS of the layer whose CRS I want to match and copied the CRS def I found in the Coordinate Reference System Selector.

    gdalwarp -t_srs +proj=longlat +ellps=GRS80 +tow
    gs84=0,0,0,0,0,0,0 +no_defs RipBuf100_09.tif RipBuf100WGS_09.tif
    ERROR 4: `+ellps=GRS80' does not exist in the file system,
    and is not recognised as a supported dataset name.


texts: grass gis- ERROR: nwalk (7000001) > maxw (7000000)!

texts:
i want to make r.sim.water (hydrological modelling) in Grass Gis, and this ERROR: nwalk (7000001) > maxw (7000000)! always appears, any ideas how to solve it?

number of cells of dem is below 7000000.


texts: GIS Metadata from GIS.NYS.GOV Shapefiles does not seem to be using Lat/Lon -- Any way to convert?

texts:
I've downloaded shapefiles from NYS for use in helping us to determine attributes of various addresses. Unfortunately the shapefiles have come from various sources, and the ones from NYS I'm having trouble getting the longitudinal and latitudinal coordinates out of the vector layers in QGIS.

http://gis.ny.gov/gisdata/inventories/details.cfm?DSID=927

I've loaded the shapefile in QGIS, right-clicked on the layer, chosen "Save as...", kept the format as ESRI Shapefile, provided a filepath and changed the default CRS from "EPSG:26918 - NAD83 / UTM zone 18N" to "Default CRS:EPSG:4326 - WGS 84" which is what I see so many topics related to this problem provide as a solution.

When I reload the new shapefile in QGIS, the coordinates are still not in longitude/latitude pairs. It appears as though I might just need to choose the right CRS, of which I'm assuming I'm not.

An example PRJ file from one of the shapefile is below:

PROJCS["NAD_1983_UTM_Zone_18N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-75.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

Any suggestions? I haven't had to do CRS conversion on shapefiles before. I've been super lucky, I guess.


texts: PostGIS Uploader - need many shapefiles in One table

texts:
How do I put many shapefiles into one table?

The PostGIS plug-in shapefile uploader makes one separate table each time it uploads a shapefile.


texts: qgis2threejs height of cylinder based on column value

texts:
What i have:

A csv file with coordinates (RT90)
A Elevation layer

What i want to do:

In the csv I have some costs and I want the 3D cylinder to represent the costs.
Higher cost=Higher cylinder

Problem
I have no problem rendering the cylinders but i can't control the height.

How do i get the plugin to understand that i want to use a column in the csv to calculate the height?


texts:
I have a geospatial dataset of air quality and I want to interpolate the air quality value across time and space for unmeasured location and time instace.
I found gstat package in R could do the spatio-temporal kriging.
However, the implementation is not very efficient. For example, this article mentioned that it took him one day to handle the data of two days (his dataset has ~6500 datapoints, I tried the code on my laptop and it seems to run forever).

Is there any packages (Python, R) which can handle data spatio-temporally and efficiently? I have a big dataset of ~20K datapoints (each datapoint has coordinates, timestamp and Z value - the air quality value).
The second question is: I know that I could use 3D kriging in PyKrige considering the time axis as the 3rd dimension. Is this a reasonable use? Any scientific reference for this use?


texts: QGIS crashes when trying to display features form MySQL

texts:
I import shapefiles into MySQL using the following command:

ogr2ogr -f MySQL MySQL:GIS,host=localhost,user=root,password=root /home/user/Public/myshape.shp -nln Shape_table -update -overwrite -lco engine=MYISAM***

but the problem is that when I try to display features directly from MySQL in QGIS, QGIS crashes.

This is the crash message:

QGIS died on signal 11[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xa63ffb40 (LWP 12279)]
[New Thread 0xae910b40 (LWP 12237)]
[New Thread 0xaf239b40 (LWP 12236)]
0xb3dabf96 in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
[Current thread is 1 (Thread 0xafb5ab00 (LWP 12234))]
#0  0xb3dabf96 in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
No symbol table info available.
#1  0xb3e89035 in QImage::fill(unsigned int) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
No symbol table info available.

...


texts: Tracking administrative changes with QGIS

texts:
I use QGIS. I have two shapefiles with the administrative boundaries in two differnet years. These boundaries have changed: some wards (smallest administrative area) remain the same, some are newly established (carved out), others have been combined.

I now need to keep track of these changes: I need to know which of the wards have remained the same, which have changed and in what way. I also need the attribute tables as they contain all the codes (and they have changed as well so I need to know which old code refers to a new code).

I used the Geoprocessing tools (union, intersect, symetrical difference) but the results are rather useless as there are many sliver polygons.

I looked at Analyzing differences between two shapefiles to put results into new shapefile? that seems to be similar but does not give me an answer I can work with.

Since I am a beginner with QGIS I am not really sure where my problem lies. Maybe the geoprocessing tools would work if I did not have the problem of sliver polygons (I have the suspicion this is the case). So now I tried to get rid of the slivers (Vector-Geoprocessing-Eliminate...) - but I get the message "could not eliminate features with these ids:" following a list of all my ids.

What did I do wrong?


texts: Extracting elevation data from DEM files using QGIS

texts:
I know how to generate contour lines from a DEM file once the file is loaded in QGIS and I also know how to open the attribute table for the contour lines which show elevation against IDs.
Is there a way to look at elevation values against sets of longitude and latitude values in QGIS?
In other words, is there a way to extract and look at XYZ data from a DEM file in QGIS?


texts: Map Service Tile Cache: ArcGIS Server 10.2

texts:
If I delete my old map services, will the associated Map Service Tile Cache be deleted as well?

For some reason the Map Server Delete Tile Cache tool is not working for me, and our tiles are cached to our server at this moment.  We need to make space on the server for new services, so I am affraid to delete the old services and have their tile cache remain on the server.

Am I safe to just delete the old services? Or is there a way to access the cache in the server manually so I can delete it before proceeding?


texts: Decent satellite map for open source project?

texts:
I'm working on a cheap open source sidewalk travelling delivery robot.  I built a GUI using Qt/QML which (among other things) I use to view satellite data to identify and manually mark where sidewalks and crossings are. The manually constructed sidewalk map is then exported to a Spatialite database and used for high level navigation on the robot.
I using Mapbox for the imagery tiles right now.  It works pretty well for just me, but I would like to open source the GUI so everyone can use/improve it.  Catch is... How do I do that and make it easy to use without letting my Mapbox key into the wild and it potentially being used in something else?  Is there any other service I could use which has enough details to see sidewalks and crossings clearly (open/free would be great)?
I'm a GIS newbie, so any advice would be awesome!


texts:
I have a map of Finland in QGIS, which says CRS = ETRS89 / ETRS-TM35 (Authority ID = EPSG:3047).

I'm trying to show the map with D3, and  can't quite match the borders/projection. The black one is the D3 output and the blue one is from QGIS:

I played around with some projections in D3 and the closest seemed to be this:

var projection = d3.geo.transverseMercator().scale(1).translate([0,0]).rotate([1, 0, -45]);

(I am scaling and translating it more before outputing. Also I used ogr2ogr to create the geojson. The data files are here.)

ogr2ogr command used:

 ogr2ogr -f 'GeoJSON' -s_srs kunnat.prj -t_srs 'EPSG:4326'  kunnat.geojson kunnat.shp

Is there a way to achieve a perfect match to that of QGIS picture?


texts: Programmatically move points in front of building polygons in PostGIS

texts:
I have an address and building table in my PostgreSQL 9.5 (x64) database on Windows 7 (x64) machine. The address points (more than one million) are inside building polygons. The sample scenario is given below:

Problem:

I want to move (perpendicularly) all address points 1 meter in front of building polygons using PostGIS script.

What I have tried:

I used this link to extract individual linsetrings from polygons and used ST_ClosestPoint() to project address point to the closest line (since address points geometry is more closer to the building facade side). The code is given below:

Select  pt, line, ST_ClosestPoint(line,pt) as close_pt
From
(SELECT  pt, ST_MakeLine(sp,ep) As line
FROM
 -- extract the endpoints for every 2-point line segment for each linestring
(SELECT
pt,
  ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) as sp,
  ST_PointN(geom, generate_series(2, ST_NPoints(geom)  )) as ep
FROM
   -- extract the individual linestrings
  (SELECT (ST_Dump(ST_Boundary(building.geom))).geom,
    ap.geom As pt
   FROM ap
Left Join building on ST_Contains(building.geom, ap.geom)
     ) AS linestrings
   ) AS segments
) As foo;

The approach might not be realistic and there could be more better and efficient way to achieve this task. So far, I ended up with this scenario using above code:

I only need the blue point in highlighted shape and this point needs to be moved orthogonally one meter in front of building polygon. Can anyone suggest me how to proceed further from this point?


texts: QGIS Reprojecting csv point file to projected CRS


texts:
Is there a way I can find and replace all layerfile paths in a folder?

I have over 150 layer files that have incorrect paths after a server migration changed the path of the layerfiles. I have found ways to change the layerfile path within an mxd but nothing on how to change all within a specific folder.


texts: Performing an Arcpy code using Python on all shapefiles in a folder or geodatabase?

texts:
I have a geodatabase with many polyline feature classes all with different names. I would like to write a code in python ArcGIS 10.1 to use a geoprossing tool on all classes in the gdb. How would this be done?

Would the same logic work for a folder of shapefiles?

For this question lets say I want to use Create Random Points 500 metres apart on all polylines in this gdb.

import arcpy
from arcpy import env
arcpy.env.workspace = "E:\Example.gdb"

arcpy.CreateRandomPoints_Management (

I asked a similar question on Stack Overflow, except using VBA to loop through a folder of excel workbooks.

https://stackoverflow.com/questions/22022672/looping-a-code-through-a-folder-of-workbooks-with-vba


texts: Segment road network line shapefile into new equal length segments line shapefile?

texts:
I would like to subdivide a road network for an entire state into segments of equal length. So, Highway X would be divided into 0.5 mile segments, with a record for each segment, and Highway Y would similarly be divided into 0.5 mile segments. Currently, segments vary in length based on intersections and curviness.

I must restrict the segments to trace the road network, so I cannot just connect vertices/nodes, or trace existing arcs/edges. In most cases, the script must insert a new vertex for the 0.5 mile point, to serve as the end point of the segment and the start point for the next segment.

I am familiar with Python/ArcPy and think I may need to use OGR to grab a list of vertices. My GIS software is ArcInfo 10.1 SP2.

Has anyone successfully implemented a solution to this problem, or have an idea on how to solve it?

I've been further exploring the standard tools in ArcGIS 10.1. I'm currently trying the idea of converting all of the vertices to a separate points layer using the Feature Vertices to Points tool. My next step will be playing with this new shapefile in Python:

The tool preserve the topology of the original line road network with the new points, and there is a sequential order to the FIDs, so I believe I can connect the points {for each road, i.e. Interstate 80} from {n} to {n+1}. I can keep track of the accumulated distance between the vertices-now-points. When the accumulated distance adding another point is greater than the threshold {d}, then I need to create a new point between the most recent point and the point-too-far at a distance that will equal the threshold. This becomes the end point for the new segment. Accumulate these points together, draw a line connecting them, and voila, a segment of length {d}. My goal of course is to have these lines be segments in a shapefile, rather than 1000s of new line shapefiles.

If anyone has any experience with those sort of geometric solution, by all means, please chime in.


texts: Are there limitations with gdal virtual raster option?

texts:
I am new at Postgis and I'm groping...

I pretend to rasterize some weighty vector layers in Postgis, do some map algebra and reclassification with them and visualize intermediate as well as final rasters in Qgis. I don’t want to have physical raster files (like geotiff or jpg) outside of DB, except at the end of the work flow.

Has anyone experienced a similar case?

I am thinking about using gdal virtual raster.

Can I use Postgis raster spatial functions with this option, or just gdal functions?

Has anyone experienced problems in Qgis viewing with gdal virtual raster from postgis db?

Thank you.


texts: QGIS 3.10 (composer) - Legend position changes when exporting the map

texts:
I know the question is quite old, since it was first asked here : QGIS map composer changing legend position when exporting atlas as images and here : QGIS composer changing legend position when exporting, but I'm having the exact same issue on QGIS 3.10, and no answer seems to work for me. since the questions were pretty ancient I thought that I should ask a new one.
I'm working with an atlas and themes to have a set of maps somehow automated. The legend is different for each page of the atlas, and so is the height of the legend. Therefor, I checked the "Resize to fit contents" box and the "Show contents inside current atlas feature" box
My legend is meant to be on the bottom right corner of the page. so I choose the bottom right corner of the legend as an anchor, positioned my legend. everything is great on the composer, the legend adapt itself but stays at the bottom right corner where it belongs... but when I export, it goes completely random.
I tried to change the Anchor (bottom right, bottom left, bottom middle), I tried to fix the X and the Y(as suggested on the others threads), but it still doesn't works...
I can't provide images of the map or the project since I have a confidentiality agreement, but I can edit to add picture of the property tab (in french) if it's useful.


texts: Splitting multi-part polygon into single polygons using ArcGIS Desktop?

texts:
How do I split a multipart polygon which consists of several polygons into single polygons so I can delete each polygon without deleting them all at one time?

I am using ArcGIS Desktop 10.0.


texts: Merge contiguous lines unless they intersect with a point

texts:
I have two PostGIS tables:

roads have an id, a name, and a geom (line).
nodes have an id and a geom (point).
They represent road tips (intersections or dead-ends).

I would like to store for each road a begin node and an end node. I know their geometries match correctly:

SELECT ST_Intersects(
    (SELECT geom FROM nodes WHERE id = 995),
    (SELECT geom FROM roads WHERE id = 421)
);
-- => true

However, I have way too many roads, and not enough nodes. Here's why:

  Red lines are road sections, yellow squares at their tips.

  Red dots are nodes. Should be the only tips.

Thus I want to merge redundant roads (have the same name and intersect at one tip and don't intersect with a node at this tip). These road sections also ST_Intersects() correctly. How can I perform this merge with PostGIS (SQL)?

I decided to proceed in two steps:

Merge all intersecting roads with the same name
Split merged roads with the points

I successfully merged the roads using this answer. First I created a new table, mroads (merged roads).

CREATE TABLE mroads ( -- Merged roads
    gid SERIAL,
    name varchar(10),
    CONSTRAINT pk_troncons PRIMARY KEY (gid)
);
ALTER TABLE mroads
    ADD COLUMN geom_tmp geometry(GeometryCollection),
    ADD COLUMN geom geometry(MultiLineString, 2154);
CREATE INDEX idx_mroads ON mroads USING GIST(geom);

I used a temporary geom_tmp column, since the ST_ClusterIntersecting method returns collections, and I don't want collections, so I'll have to process them later. Then I merged the roads:

INSERT INTO mroads (name, geom_tmp)
SELECT name, unnest(ST_ClusterIntersecting(geom))
FROM roads GROUP BY name;

I ran into problems about how collections didn't have a SRID, and some other things. My tinkering resulted in this:

-- SRID for my data is 2154 (Lambert-93 for metropolitan France)
SELECT UpdateGeometrySRID('public', 'mroads', 'geom_tmp', 2154)
-- ST_ClusterIntersecting did not actually merge geometries,
-- it regrouped them in a collection. We ST_LineMerge this collection.
UPDATE mroads SET geom = ST_Multi(ST_LineMerge(ST_CollectionExtract(geom_tmp, 2)));
ALTER TABLE mroads DROP COLUMN geom_tmp;

(Trivia: I had 756k rows, now there are only 91k of them.) Now, I want to split mroads wherever they intersect with nodes, unless it's at the very beginning or end of the line. I expect to produce more tuples.


texts: What is the difference between mean coordinate(s) and polygon centroid tool available in QGIS.


texts: ArcGIS Server 10 Manager remote viewing is seemingly broken

texts:
When remoting into a server, then launching ArcGIS Server Manager...I can not use any of the buttons or  even view the entire web page.  I encountered this at 9.3.1 and would just launch the desktop app of AGS Manager.  At 10 there doesn't seem to be a desktop app.  I was browsing using IE (I don't know which version).

Is there a work around for this..other than not remoting in?  I have seen where some of the interface can't be scrolled to but I couldn't even click the buttons.  Thanks.


texts: Converting in batch into 8 unsigned bit format using GDAL?

texts:
Could you please correct my batch command?

I had 100 img images which need to be converted into 8 unsigned bit format for further use in TIMESAT.

mkdir test
for %%f in (*.img) do gdal_translate -of ENVI -scale -1 1 1 255 -a_nodata 0 -co INTERLEAVE=BSQ "%%f" test/%%f.dat


texts: compare column to atributes in a loop in pyqgis processing

texts:
I am creating a script in processing qgis. I am running the interpolation algorithm.I have two tables table A and table B. Table A contains attributes like A_test,B_test up to Z_test. Table B contains columns A_test,D_test. How can I programmatically compare the attributes from table A to the columns in table B. The table B will always be different and can contain all values in table A or limited values. The syntax I had in mind was a for loop with condition

if table A.attribute = table B.column
    then run algorithm else
     raise exception


texts: Create new shapefile based on values ranges in existing shapefile using gdal/ogr/python

texts:
I have a shapefile containing many thousands of polygons with values stored in an attribute field and ranging 0-105. I would like to create a much simplified file that contains classes for value ranges. E.g. values 30-50 = class 1, values 50-70 = class 2, values 70-100 = class 3. The classes can be integers. Would it then be possible to simplify this to a shapefile containing 3 feature classes (class 1, class 2, class 3) each class containing every polygon fitting those criteria?

There are no overlapping polygons. Attributes from the original shapefile do not need to be preserved. I'd like to use python and ogr to accomplish this.


texts: How to meet "Contour plugin" and "Profile Tool" dependencies in OSX?

texts:
So I have two similar but different issues than my previous question, one I may have mentioned already. When attempting to install the Contour plugin I am told I need matplotlib, which I have on my system (v. 1.1.1).

Also, the Profile Tool is telling me I need Qwt5...I have no idea what this is.

I posted earlier about needing Shapely.wkd for the Profile from Line tool, and received a response that the issue has to do with incompatibility between pyQwt5 and pyQwt.

The Contour plugin does not seem to be related to the Qwt5 issue. Is it possible there is a suite of python modules I am missing on my install?

Install: KingChaos 1.8.0 Lisboa
System: MacOSX 10.7.5

I really enjoy QGIS, but I want it to work correctly.


texts: exp function not recognized in Raster Calculator?

texts:
I am trying to preform a calculation for the exponential increase in cost of a slope, using the "exp" function, but get an "error parsing formula" message. The expression as I've written it is:

1000*(exp("Slope@1"*0.2)-1)

where "slope@1" is my tif file, and what I'm trying to calculate is essentially: Slope_cost = $1000 * {Exp(slope_percent * 0.2) – 1}

How/does the exponential function work on Raster Calculator? I'm using QGIS 3.8.3 Zanzibar version


texts: Toolbox blank when sending to someone else?

texts:
I have a toolbox with two models that I am trying to send to someone else. I am working in 10.4 and he is working in 10.3.

I save my toolbox as a 10.3 toolbox and send him the .tbx file, but when he loads the file the toolbox is blank. There is no drop-down button and no models in the toolbox. It is worth noting that when I try to open the 10.3 toolbox in my own project there is nothing there either.

What could be the problem?

Edit: To add to this, I can't share my results as a geoprocessing package either. I get an error that says

  General function failure Error 999999: Error executing function.


texts:
I am working with the block group shp files that I got from tiger 2010. When I bring in the shp files some of the block groups show up, but this is spotty.

I have adjusted the CRS and still nothing.

I have tried highlighting everything and checked the attributes table; all of the polygons seem to be there but only about 50 are highlighted.

When I tell it to zoom to the layer extent it goes to the area that looks like it would encompass the entire state.

I have also re-downloaded the zip file and extracted them but with no success.

please help


texts: Dynamically change labels/symbology to create multiple maps of the same dataset in ArcMap 10.1

texts:
I'm working in ArcMap 10.1.  I have a data-set of multiple acreage fields that I am joining against a polygon shapefile.  Let's say I have acreage fields X, Y & Z (in reality there about a dozen acreage figures per feature/polygon).  I have a label expression that shows an acreage figure for each polygon on the map.

Now, I'd like to automatically create maps, each showing the same polygons, but with different acreage figures (from X, Y or Z) & different symbology (Quantities -> Graduated colors) for each of my acreage fields.

Initially, I was hoping I could use data-driven pages to handle this, but there doesn't seem to be any way to dynamically switch label expressions (or symbology) based on the current page, for example.

I have some experience using the arcpy scripting lib, so that is an option as well (though I couldn't figure out how to update my symbology based on the current acreage field).

How can I do this without manually making a data-frame (or .mxd file) for each acreage field.  That is, I want to avoid having to manually make several dozen maps showing the exact same features, just with different labels/symbology.


texts: Duplicating Layers to new, independent layers in QGIS 3

texts:
I am currently working on a rough freight railway station planning project in QGIS 3 and it's output should be different "alternatives" (as layer groups) with different layers to each.
For example
Alternative 1: 500m rails and two railway switches.
Alternative 2: 300m rails and just one switch, etc.
In total there will be 5 alternative designs in the project. Every alternative is one layer group, every attribute / feature (read here, rail line, road) of the alternatives is a layer (withing the group).
Since the alternatives are closely related to each other, I would like to copy a layer group with it's layers and modify the other alternatives from them.
For example, I want to use Alternative 1 as "foundation" for the other alternatives and remove one of the switches and shorten the railway line.
Yet, QGIS keeps the same source, which results that if you edit the layer in Alternative 1, it will also affect Alternative 2.
So how the small help I need is an advice on how to copy layers, and then save them "independently" so changes wont affect the different alternatives.


texts: Identity tool FID column name gets cut off

texts:
After my ArcMap extension executes the Identity tool, the resulting identity shapefile has FID columns for the "input features" FeatureClass and the "identity features" FeatureClass but the column names get cut off. I need to access these columns when looping through the identity shapefile later.

I thought I could find the field by name to get the column index but I never know what they are going to be called. It is "FID_" plus some part of the input's name but the column name string is too short to just compare the strings. The inputs might have similar names.

If I do this manually in ArcMap, it does not cut off the names. The column name will be 'FID_" plus the full name of the input feature FeatureClass name.

Is there a way to set what the FID column names will be?


texts: I use GRASS plugin inside QGIS on Japanese version of windows 7 x64. As I start GRASS tools, all the content show in English but when I try to execute a tool, tools option displays in Japanese language. I want to change all the tool options in to English and have no clues how to solve it.


texts: Geoserver LegendGraphic support for Rules in SLDs

texts:
I want to serv custom legend via GetLegendGraphic WMS request.
I find two answers:

http://jira.codehaus.org/browse/GEOS-3747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
https://github.com/geoserver/geoserver/pull/397

On first site there is patch file to geoserver, but I don't know how to use it (where to paste it).
On second site is github so I clone repo and build geoserver by myself, but what now? I try add <LegendGraphic> -> <Graphic> -> <ExternalGraphic> -> <OnlineResource> to SLD file but geoserver don't validate it.

So can anyone explane how to get custom legend?


texts: How to use spatialite and the tz database to tag many points with time zones

texts:
I have a spatialite database containing every journey I have made every day since April 2003. I use this importer I co-wrote to populate a 'tracklines' table and a 'trackpoints' table from gpx files: ptrv/gpx2spatialite.

For another application (the geolocating of all my sms text messages!), I want to tag the points (probably in a separate table) with a time zone from the tz database, giving me a way of deriving the local time for these points as a starting point to matching up with text messages I have sent.

I have tried with python and the timezonefinder module but it is super slow, hence turning to spatialite since the points are in a spatialite database already. I then tried to follow some of Alessandro Furieri's excellent spatialite cookbook recipes but I can't find something that hits the spot.

I know I need to make a spatial index but I'm confused about whether the points or the time zones need one (or both?) and then what a moderately efficient query would be to associate millions of points with timezones. I say moderately because I would only have to run this once and store the results in a table (unless someone knows a better way?)


texts: I'm setting up this API that let's users upload high resolution images then generate tiles with those images using gdal2tiles. My question is what's the recommended way to host a tile map service? I am following these steps, but it looks like it expects me to update the XML files each time a new tile map is generated / uploaded.


texts:
I have read several tutorials and questions here on this site, but I have some lingering questions/doubts that I would like clarified.

My project is tracing roadways from a 1926 map so that I can compare infrastructure then and now. I have successfully georeferenced my 1926 raster map onto a contemporary shapefile, reduced transparency, etc. I have enabled freehand line editing, which is the best way to accomplish this task, it seems. My map has two kinds of roads shown that I want to trace: the paved roads, and the unpaved roads (marked by full, bold lines and staggered, broken lines). So, then, here is what I would like clarified.

In the New Vector Layer box, an option is given for Name, Type, Width... I have named the feature line 'roads,' which is relevant for question #2. What exactly is the Type option (text data, whole number, decimal number, etc.) for, what is it not for, and could someone give a quick example of when this option might be useful?
When I trace with the freehand edit tool, I realize that when I unclick, several points/nodes/features (whatever they are called!) are placed along the traced line as if I clicked them each individually. OK... so there appears a popup box asking me for 'id' and 'roads'--'id' is blank, and 'roads' is 'NULL.' What exactly is going on here with this? So far, I have simply left the box as-is and clicked 'OK.' Would I regret this later if I wanted to edit the lines or something? What is the point of this box, the information in it, and how is it useful?
The paved roads I want to trace are not connected to each other--some paved roads in the north, south, etc. So far, what I have been doing is tracing a line of paved roads as described above, and then moving my location in the map to do the same in the north or other areas. Following this procedure as described, will all the lines traced be counted/recognized as the same feature/network of feature? Is it alright to trace a road coming into a city from one direction, unclick, and then trace the road coming into the city from the other direction, and will it still be part of the same road?
How do I trace the unpaved roads once I get the paved roads all traced? (I suspect that I would need to allow for this when creating the new shapefile layer from the start, by adding a 'roads' AND another thing like 'unpaved roads,' is this correct? But if I have not done this from the beginning, am I screwed and should start over?)


texts: PostGIS & QGIS 3.4 : convert mixed Linestring/Multilinestring geometry to multilinestring

texts:
I have a PostGIS table in which the geometries are mixed Linestring and Multilinestring. But QGIS doesn't like it very much (it splits the table by the different geometries in the "add PostGIS table" dialog for example).

I would like to have only multilinestring type. I tried converting the type with

ALTER TABLE LaTable
    ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 31370)

but I got error

ERROR:  Geometry type (LineString) does not match column type (MultiLineString)

I even tried the other way around (multilinestring --> linestring) but I also got the error the other way around :

ERROR:  Geometry type (MultiLineString) does not match column type (LineString)

Is there an other way I could get a single-type geometry on this table ?