texts: How to apply symbology from another layer in arcpy

texts:
I'm trying to add symbology to a group of feature classes. Listed below is one example. The field names are the same, but the symbology isn't working in arcpy. It does however work when I used the apply symbology tool in ArcMap.

  ## Import system modules
     import arcpy
     import os
     from arcpy import env
     import datetime

  # define variable to be used at end of code to change setting back to default
    origSetting = env.overwriteOutput
    # change environment setting to overwrite output
    env.overwriteOutput = True

################################################################################
def makeMap(city):
newName = arcpy.ValidateTableName(city.strip("'"))
#get the map template
mxd = arcpy.mapping.MapDocument(r"C:\Template20160603.mxd")
dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0]

#Locate the layers to add to the map
folder = r"C:\test" + "\\" + newName

#loop through the layers in the city folder and add them to the mxd
walk = arcpy.da.Walk(folder, datatype=['Layer','FeatureClass'])
print "Adding layers to map for", city,"\n"

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        print filename
        layerfile = os.path.join(dirpath, filename)

        #add indicator layers to map and ensure that the error layer is above the corresponding indicator layer

        i=filename.find('CT')
        if i!=-1:
            CTLayer = arcpy.mapping.Layer(layerfile)
            arcpy.mapping.AddLayer(dataFrame, CTLayer, "BOTTOM")
            #zoom to current county extent
            dataFrame.extent = CTLayer.getSelectedExtent(False)
            dataFrame.scale = dataFrame.scale * 1.01

        indicator=("x","y")
        if any(s in filename for s in indicator):
            addlayerrse = arcpy.mapping.Layer(layerfile)
            addlayerrse.name = str(addlayerrse) + "_rse"
            arcpy.mapping.AddLayer(dataFrame, addlayerrse,"BOTTOM")

        strings = ("a", "b", "c")
        if any(s in filename for s in strings):
            addlayer = arcpy.mapping.Layer(layerfile)
            arcpy.mapping.AddLayer(dataFrame,addlayer,"BOTTOM")
            if indicator=="a":
                test=r"C:\Symbology\SymA.lyr"
                addSym = arcpy.mapping.Layer(test)
                arcpy.mapping.AddLayer(dataFrame,addSym,"BOTTOM")
                arcpy.ApplySymbologyFromLayer_management(addlayer, addSym)

date=datetime.date.today()
#create a mxd with city name and date program was run
mxd.saveACopy(r"C:\mxd" + "\\"+ newName + "CT_" + str(date) + ".mxd")

del mxd

print "\n","Program Complete"

makeMap("cityx")


texts: ArcGIS Portal error "Accessing Data failed"

texts:
In ArcGIS server I have published a dynamic map service, but in ArcGIS portal while accessing same map service using add data option "Add layer from web" getting error "Accessing Data failed" while loading service. In service pooling I have set service timeout upto 300 seconds(5 minutes).

I am not getting any error while fetching data from attribute table of source MXD and querying from published service.


texts: ArcPy Script Tool multi-value re-order buttons

texts:
I'm trying to set the values of one control (Multi-value, data type: string ) to another parameter control (Multi-value, data type: "any value" which produces a drop down with grid for items entered or selected with the add, delete, and re-ordering (up/down) buttons).

The goal is to use the reorder buttons on the 2nd control (of the auto-populated items) to reorganize the list by moving rows up and down, then taking the values out (as text type is fine) and processing them further.

The issue is that I can get the items to populate into the 2nd control (via the ToolValidator class, updateParameters method) but I can't change their order.  If I use the text entry box to populate the grid, it will allow me to change the order of the items.

Here's the code snip:

    def __init__(self):
    """Setup arcpy and the list of tool parameters."""
    self.params = arcpy.GetParameterInfo()
    global PriorParam
    PriorParam = ""

    def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""
    global PriorParam
    PriorParam = ""
    return

    def updateParameters(self):
     global PriorParam, selected_items_list
     if self.params[2].value:
         domains = arcpy.da.ListDomains(self.params[2].value)
         self.params[3].filter.list = [domain.name for domain in domains if       domain.domainType == "CodedValue"]

     if self.params[3].value:
         domains = arcpy.da.ListDomains(self.params[2].value)
#Probably a more direct way to grab the actual domain object but this works for now.
         for domain in domains:
            if domain.name == self.params[3].value:
                coded_values = domain.codedValues
         self.params[5].filter.list = [val.encode('utf-8') for val,desc in coded_values.items()]

     if self.params[5].values  <> PriorParam:
        PriorParam = self.params[5].values
        working_param = self.params[5].values
        self.params[6].values =  working_param # .params[5].values
     else:
        arcpy.AddMessage("Param5 didn't change after validate review.")
     return

Even though the Up/Down arrows are enabled, they don't actually re-order the items.  Am I using the wrong Data Type or is there some other storage location I should manually be moving the items from the "Code(s) to move"  to get them into the SequenceTheMoveCodes parameter control?


texts: Projecting the raster and vector to the same place

texts:
I have 3 groups of raster layers all in the same place, but my group with my vector layer are located above... I am working in QGIS.

They all have the same CRS WGS 84 / EPSG Greenland Polar Stereographic, EPSG:5938.

The project, each vector layer and raster layer have the same CRS.

Why are they not on the same position and how do i get them to be that?


texts: Setting correct start and end time series for Savitzky-Golay in R

texts:
I am trying to smoothen my raster stack using Savitzky-Golay method. I am following the workaround from HERE but my problem is setting start and end of my time-series raster. My series of images were from October 2018 to March 2019 and can available HERE.

My code goes like this:

r <- stack("./KT_DS18_rice_ts.tif")
names(r) <- c("2018-10-08","2018-10-24","2018-11-09","2018-11-25",
                      "2018-12-11","2018-12-27","2019-01-09","2019-01-25",
                      "2019-02-10","2019-02-26","2019-03-14","2019-03-30")

fun <- function(x) {
  v=as.vector(x)
  z=na.spline(v)
  s1.ts2 = ts(z, start=1, end=nlayers(z), frequency=12)
  sgolayfilt(s1.ts2)
}

fun(r)

I want to smooth the EVI curve of each pixel from the first layer (start) to the 12th layer (end). That code above gives me this error:

 Error in (function (classes, fdef, mtable):unable to find an inherited method for function ‘nlayers’ for signature ‘"numeric"’


texts:
I have a problem with Geoserver with multiple layers. At the moment the idea is to print a map of Europe, then paint 3 layers on top of this to get 3 different values matches up in a polygon. However the color and font are changing because on the layers being painted on top of eachother. Is there an easy solution to make all fonts and colors the same even when painting multiple layers on top of each other?

Thanks in advance!

Picture of what I mean: http://imgur.com/MyiypeO


texts: AutoCAD 3D (2014) conveting a TIN to ASC

texts:
I am using LIDAR ASC files to generate a large storm water catchment area which I would like to then combine with some survey work including river bathymetry to actually combine the data to have one complete surface file so we can complete a flooding model of our at risk coastal foreshore communities.  Our survey work is in A3D and our flood modelling software (XPSWMM) prefers ASC file types, my problem is exporting from AutoCAD 3D and getting the file into a ASC file type.

Once I get all the files into an ASC format I have no issues about combining the files together.  I just can't figure out how to get from A3D to asc file type! I am just getting frustrated now!  I know it should be simple, we are using two leading software packages and there seems to be no easy transfer of data.

Software I have at my disposal to achieve this is; A3D, FME (limited experience), MapInfo with engaged 3D extension, XPSWMM.


texts: ArcGIS 10 Raster Mosaicing versus Lizardtech Express Server

texts: Trying to determine if I still need to use Lizardtech Express Server to mosaic rasters together or just use the Mosaic Raster Dataset function of ArcGIS 10? I know for earlier releases of Express Server and ArcGIS you could find info on tying the 2 together but I can't seem to find anything about it now. I've learned that when the silence is deafening on a topic it generally means that "they" want it to just die and go away. Help me StackExchange GIS, you're my only hope.


texts: Looking for more realistic 3D terrain renderer than ESRI Arcscene

texts:
I am looking for simple suggestions of software packages that go beyond what ESRI ArcScene can offer.

I want to create 3D terrain visualisations, particularly of orthophotos draped over high quality DEMs. However I would also like more control of atmospheric conditions (eg haze), lighting, surface texture, clouds, and antialiasing. I'm looking for recommendations for packages that are relatively simple to use (like ArcScene) and which load GIS data natively.

I would be happy with very short replies along the lines of "try this package X" or "have you looked at package Y, it's great, we use it at work...". [Editor: put these as comments instead of answers please]


texts: How to project a large nonortho satelite image on a much smaller high res DEM?

texts:
I am currently attempting to orthorectify an image using GDAL. I have a very detailed DEM that I would like to rectify the image on top of. However, the DEM is smaller than the image itself; this is fine though since I only want to orthorectify a small portion of the image. However, to do so I must crop the image to that small region or orthorectify and then crop. The issue is that since the DEM is smaller than the image, orthorectification failed with the "too many points failed to transform" error message with GDAL warp. As such, the alternative would be to crop the image, but I have no idea how to crop non-orthoimages in GDAL. The input file is currently in a VRT file which refers to the originalDEM file and contains the RPC camera information.

So in short, how can I accomplish this task with GDAL? Are there any other tools I can use? Or will I have to completely rethink my approach? Is there a way I can buffer my DEM with 0 values so that it orthorectifies without errors and then crop it? Or would I have to figure out how to crop it first?


texts: Merge several images and Export a GeoTiff File

texts:
I have approx 500 geo-referenced images that I was hoping to merge into 1 geo-referenced file, and export it as a single geotiff file. To be used in AutoCAD Civil 3D

I know I am pushing my luck and that QGIS moves. I get an error if I tried to merge all the files in 1 go. Same happens if I try building a virtual raster catelogue.

I have tried merging the files in 5 groups, by either building a virtual raster catelogue or merging the files. Then merging the 5 groups into 1 file.

However the above solutions all result in a blank image from exported (Layer -> Save As)

I have read building a pyramid may help using the .vrt file.


texts:
I am getting an error message when atempting to Create a connection in Arc Catalog. The message is : Failed to Connect to database
SDE not Running on Server
Then I Check the Service esri_sde it has not started, so when I try to start it I get the message : The ArcSde Service(esri_sde)service on Local Computer started and them stopped.
i found sde_esri_sde.log file . the error messages are :
IDBInitialize::Initialize Failed
DB_open_instance() PCC_connect error: 2
init_DB DB_instance_open_as_dba: -51
DBMS error code: 2
Microsoft SQL Server Native Client 10.0: Login timeout expired
 i dont know what's wrong ... ?!
please help me


texts: QGIS 'Add Circle' Feature not working correctly?

texts:
I'm new to QGIS. Recently, I had my first experience of having to draw a circle. This is in a Geopackage layer using the 'Add Circle' option from the Edit menu, only whenever I go to draw it, it ends up...not circular.

Circle preview:

Circle drawn:

Somebody else had a similar problem, see here: QGIS3 Shape Digitizing Circles is Drawing Improperly . Setting my coordinates to EPSG:3721 does allow me to draw a proper circle, but when I switch back to EPSG:32230 it's an oval (and I'm not sure how well EPSQ:3271 works for local-scale mapping in Scotland...). Is there any way around this that doesn't involve changing projections?


texts: Execution of a QueryTask for ArcGISDynamicMapService

texts:
I am going to display the query results on infotemplate. I have written the code which I have mentioned below. After execution of this code just getting a point on map but not getting infowindow popup. Please suggest me where I have to modify my code to the query results on infotemplate.

<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.17/esri/css/esri.css">


texts: Convert a string of coordinates to a readable polyline for export as GeoJSON

texts:
I need to take an xls file which has multiple columns of data, and a column called coordinates which is a string of coordinates (ex. 147.775364306,-20.49918551,0 147.776402476,-20.500021717,0 147.778202959,-20.5015774579999,0), and convert it to a GeoJSON file.

How can I do this easily?


texts: How to remove z & m coordinates from kml files

texts:
I've recently received some parcel data in shapefile format that has z & m coordinates (all = 0.0). The WKT for a typical parcel looks like this:

"MULTIPOLYGON (((2672464.560700002 711396.4336998622 0.0 0.0, 2672428.060700002 711369.2463998601 0.0 0.0, 2672373.310000001 711454.3723998595 0.0 0.0, 2672410.0600000033 711481.4969998623 0.0 0.0, 2672464.560700002 711396.4336998622 0.0 0.0)))"

This data is not being accepted by my ruby gis program/libraries (rgeo) when I try to parse the WKT. I could use gdal/grass (little to no experience), Python (little to no experience) or some other ruby library, but I'd prefer to sanitize this code of its 3D (Z) and M coordinates using qgis.

Given the fact that this question has been unanswered for days ANY solution would be appreciated, including grass, gdal, other ruby libraries, python, even arcgis (I have a new PC so can do a new 30 day trial...)


texts:
I am using qgis version 1.8.0. My project contains tiff and several "shape" layers. The CRS is WGS 84 (EPSG:4326). I am attempting to measure the areas of the layer polygons. However if I click on the symbol "Measure area", I am getting a message. It keeps telling me the measurements are problably wrong.
(Testing this statement by measuring leads to enormous but wrong values)
It suggests to define a coordinate system in project properties. I have been trying this serveral times - with no results.
Furthermore I read "Working with Projections" and "Measuring" in the User guide (http://docs.qgis.org/user_guide/html/en/user_manual/introduction/general_tools.html and http://docs.qgis.org/user_guide/html/en/user_manual/working_with_projections/working_with_projections.html). Also after adjusting all other CRS settings the problem stays.

What should I do ?

Thank you for your advice


texts: Formula to convert from WGS 84 / UTM Zone 34N to WGS 84?

texts:
Can anyone help me with the formula for converting from WGS 84 / UTM Zone 34N to World Geodetic System?

My problem is I want to represent some properties (polygons) in some kind of a map (image). I have the data stored in SQL Server (the points of the polygon). The SQL Server uses WGS 84 / UTM zone 34N to represent the polygons. My development environment uses a simple XY system. I want to convert these data in latitude and longitude so that I can draw a simple map in my program.

So far I have found a converter online: http://georepository.com/calculator/convert/crs_a/4326/crs_b/32634/operation_id/16034

However I would like to know the formula for doing this, since I want to use it in my code. Some samples are:

 Easting (Metre): 398676.179117283 ----> longitude : 19° 47' 20.659" E
Northing (Metre): 4576702.45725602 ----> latitude  : 41° 20'  7.586" N

Maybe I am being unclear. However, let's say that all I want is to convert from UTM to GCS WGS84. Can anyone help me with a formula?

In other words I want to do what the converter I does.


texts: OD-matrix (QNEAT3) doesnt return values for all input parameters in QGIS?

texts:
I'm running into problems trying to calculate shortest distance from point (smaller black dots below in image) to a port (tagged MANAUS below). Im using hte QNEAT3 OD-matrix tool (from layers as lines). Networks are the roads (red-ish) also depicted below in image.

Two of the input parameters return no value, it doesnt look like it is because they are not located "near" a road as other input parameters located further away dont have the same problem. I also tried the from points as .csv option with no difference in outcome.

Does anyone know what the problem might be?

(im doing this for a large dataset (5700 origin locations to 9 destination locations, and so need it to function allright. this is just a test to see how the model runs... )

CLARIFICATION:
This is one of the output attribute tables i get from the computation. For many of the OD's i get no value in return (empty cells, eg fid 8 and 9), suggesting that there would be no network connection, which is not true:


texts: Leaflet Routing Machine: how to export route details and coordinates in JSON / GeoJSON?

texts:
I need to export / save the route details found using Leaflet Routing Machine in JSON or GeoJSON format.

I've tried to  use

var routeArray = new Array();
routeArray = control.getWaypoints();
alert (JSON.stringify(routeArray));

that works but in this manner I obtain only the waypoints and, instead,  I'm interested at ALL the route details (coordinates  and descriptions).

I guess that "somewhere" they are (in the picture when I put my mouse pointer on a description I can see a little blue circle on the map as you can see .... )

Any suggestion, example, jsfiddle to help me?


texts: How to open a .k format (I think it is made with IDRISI product) with open source software

texts:
I just received a .k file which I know it was made with a IDRISI software (I do not know which). I searched the web and I did not find many information on this format apart for a very essential page with few useful info. It seems from what I read that this could be a kind of container for the IDRISI raster files? Am I wrong?

I tried (of course not successfully) to import it (with the raster import functions) in QGIS, GRASS GIS, SAGA GIS. GRASS and QGIS returned this message:

  D:\XXXXXX\RESULTAT_TAYMA_4500.K is not a supported raster data source
  Ungridded dataset: At line 4, X is 4.000000, where as 1.000000 was expected

I work on Windows 7 with open source software (mainly QGIS, GRASS and SAGA).
Does anybody have some tips about this file format?


texts: Generating service area in ArcGIS Desktop without Network Analyst License

texts:
I am working on a project currently that relates to creating service areas for points across California based on streets.  I created a python script that can take a point and create a buffer around it, get intersection points of where the buffer intersects streets and then create a smaller buffer around those points.  This would continue until the buffer size would be 0.  An example is starting with a 5 mile buffer and work down in one mile increments until reaching 0.  This was our original make-shift idea of creating service areas without  a network analyst license.   I realized after doing this though that this does not take into account at all that matter of possible barriers. Such as a river in-between 2 parallel streets – this form of analysis might include that parallel street even if there was not a nearby bridge to actually cross over into the street.  I am now trying to find an alternative method that can do something similar but account for possible barriers like that of the service area tool in Network Analyst (I am trying to find a workaround due to licensing limitations).

Do you have any possible ideas of a way I can do this type of analysis without having to use Network Analyst?


texts:
I have this NDVI image of eucalyptus trees. I've already been able to isolate the trees and extract the location.

Then I created the delaunay triangulation, turned it into lines, and then exploded to separate the lines and removed the duplicates.

What I want is to be able to join these pieces of lines so that they form a line in the same direction. As it is in yellow in the image below. I need to do this for the whole image.

I did using QGIS but any help using GRASS, SAGA, Postgis, python, etc, is welcome!


texts: Expression that selects all objects with same value in field one and among the choosen ones figures out the highes value in field two

texts:
I have an Attribute table similar to the one in my example Picture, just with thousdands of objects.

Some of the objects have the same value in "field 1" but different values in field 2. I want to write an expression that finds all objects with same values in field 1, among them compares the values in field 2 and memorizes the highest value and finally gives all the selected objects this highest value in field 3.

The expression should do 3 things.
1. the expression selects all objects with same values in field 1. For example in my image it selects the last object, the second last object and the object exactly in the middle.

It checks for the highest value in field 2 among them.
It gives all 3 objects the highest field 2 value in field 3.

Would that be possible?


texts: Incremental trace number when features are copied

texts:
With QGIS 3.12, can I copy and move feature and give the copied feature a tracing Id number ?

For example, I have a tree with a numeric field (Tree number) 1,2,3 etc.

When I copy the tree, I want this field to "move forward" automatically +1.


texts: Seeking library to do Spatial Network Analysis using QGIS

texts:
I am new doing network analysis out of R, I would like to know which is the best library to fulfill a spatial network analysis with Qgis?

I have been trying with Qnetwork, but I have problems by establishing the relations between areas.


texts: How to unset an event listener in OpenLayers 6?

texts:
I am trying to use '.un' to unset the 'single-click' event listener. I have tried all the ways available. How can I do this?

measurePoint() {
  const that = this;
  this.mapObj.on('singleclick', (e) => {
    if (this.measureType === 'point') {
      const coods = e.coordinate;
      // some code here
    }
  });
}

measure(type: any) {
  this.mapObj.un('singleclick');
  // some code here
  if (type === 'point') {
    this.measurePoint();
  }
}

ngOnDestroy(): void {
  this.mapObj.removeLayer(this.vector);
  this.mapObj.un('singleclick');
  // some code here
}


texts: OpenLayers "Text" layer always visible on load

texts:
I'm trying to load a layer as an overlay and make it initially not visible

    airBoss = new OpenLayers.Layer.Text( "AirBoss Locations", { location:"./airboss.txt"} , {
    visibility: false, isBaseLayer: false, displayInLayerSwitcher: true});
    map.addLayer(airBoss);
    airBoss.setZIndex(210);
    airBoss.setVisibility = false;

Using this code with or without the additional "setVisibility" line the layer always is visible.  Is this a bug in the JavaScript of OpenLayers or am I doing something wrong?


texts:
I used the plugin successfully.
But yesterday, after changing several buildings in JOSM.
Import under qgis with the plugin does not work anymore.
The buildings are in the layer point!
Do you have any idea?


texts: Rotating labeling of grid in ArcGIS Desktop?

texts:
I have a doubt I would like to know if you can rotate the labeling of the grid. Look at the image 1, the grid is rotated but the labeling is still perpendicular, I need the labeling to be parallel to the grid or inside it, as well as in the image 2 that was made with the autocad civil

image 1

image 2


texts: ST_DWithin in PostGIS: Implicit index call

texts:
In PostGIS, the function ST_DWithin automatically includes a bounding box comparison that will make use of any indexes that are available on the geometries. This is done using the mechanism of inlining SQL functions. The definition of the function is as follows.

CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8)
    RETURNS boolean
    AS 'SELECT $1 OPERATOR(@extschema@.&&) @extschema@.ST_Expand($2,$3)
    AND $2 OPERATOR(@extschema@.&&) @extschema@.ST_Expand($1,$3)
    AND @extschema@._ST_DWithin($1, $2, $3)'
    LANGUAGE 'sql' IMMUTABLE _PARALLEL;

Why it is necessary to call twice the ST_Expand function, one for each geometry? Wouldn't a single call like in the following definition be enough?

CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8)
    RETURNS boolean
    AS 'SELECT $1 OPERATOR(@extschema@.&&) @extschema@.ST_Expand($2,$3)
    AND @extschema@._ST_DWithin($1, $2, $3)'
    LANGUAGE 'sql' IMMUTABLE _PARALLEL;


texts: QGIS's raster calculator-- running as a batch process?

texts:
I have a series of raster files (150 or so) that I need to multiply by a baseline raster. Unfortunately, the series of rasters have a different cell size (30m×30m i.e. .00027777778 degrees × .00027777778 degrees) than the baseline file (.1 degree × .1 degree).

I ran a test using qgis' raster calculator (which is under the menu path: raster->raster calculator...) and it worked fine as far as I can tell. That is, QGIS was able to reconcile the differing cell sizes and complete the action as expected. However, when I went to batch the process, I discovered its not possible — at least not from the GUI.

When I tried the SAGA, GRASS, and GDAL_CALC algorithms it appears the differing cell sizes are presenting issues. As a note, the basline file currently has a worldwide extent whereas the other files are smaller subsets.

Is there a way to call QGIS' raster calculator as a batch process or from a scripting language?

Example gdal_calculate input:

python gdal_calculate.py --outfile= C:/Users/asd/Documents/MangWork/TestImage/gdalcalcout.tif \
                         --calc "(han*adj)" \
                         --han=C:/Users/asd/Documents/MangWork/TestImage/cl_MEX_30N_110W.tif \
                         --adj=C:/Users/asd/Documents/MangWork/TestImage/Correction_Raster_Comp.tif \
                         --cellsize=MINOF


texts: Identifying top 10% of raster cells using ArcGIS Desktop

texts:
I have a raster with different risk values for a hazard.
How can I identify the top x% (eg. 10%) of the raster cells with the highest values within ArcGIS Desktop?


texts: How can I create the visible horizon from a point?

texts:
I'm trying to do shading analysis as part of a building energy simulation and for this I need to find the horizon as seen from the highest part of my building of interest.

I have the MasterMaps Topography layer and building heights saved in a QGIS database. Is there a simple way of creating the horizon from a specific viewpoint from these?


texts: Converting from SHP into TXT file using PyQGIS

texts:
I'm working with many shp file point format with geometry attributes like this:

But I need convert it into such format in textfile like below:

Are there any ways to arrange my shapefiles format into coordinates separated by comma orderly using PyQGIS or another python script.

Since I'm still learning with Python, I try to learning by doing.


texts: Differences between two datasource options in GeoServer

texts:
We have two datasources in GeoServer for SQL Server.  What is the difference between them?

 Microsoft SQL Server - Microsoft SQL Server
 Microsoft SQL Server (JNDI) - Microsoft SQL Server (JNDI)


texts: Resolve polygon parent relationship in QGIS

texts:
I have a layer in which, following geometry processing, the polygon of a zone that is a full enclave to another seems to have become its child object, which I think will cause problems down the line.  How can this be resolved so the enclave shares the same shapefile parent as its neighbour?

Thanks in advance.  The Shapefile is available here.

The area:

The child feature (Carlisle) visible on inspection as child of surrounding Penrith.


texts: Using GDAL or Python, how can I merge/combine 3 NITF images (RGB) into one image and keep the RPC metadata intact?

texts:
I'm looking to merge 3 imagery bands that are saved as separate files. The file format is NITF. The reason they are saved as NITF is because they have RPC metadata embedded into the images. I would like to combine the NITF images so the output image retains the RPC metadata. I will be doing this a lot so I would like to build a script either through Python or GDAL so that I don't have to do this manually. Unfortunately I'm very much a novice when it comes to scripting, and after scouring the internet I have hit a road block. I was able to successfully merge the images in the desired output using GDAL, but the RPC metadata did not transfer into the output image.

Here's the code I have so far:

gdal_merge.py -o output.ntf -of NITF -seperate red_band.ntf green_band.ntf blue_band.ntf -co PHOTOMETRIC=RGB


texts: Google Earth Engine: Evaluate classifier of output type regression

texts:
Background
According to the Google Earth Engine documentation for supervised classification, the accuracy assessment of classifiers such as ee.Classifier.smileRandomForest can be done using a confusionMatrix():
// Make a Random Forest classifier and train it.
var classifier = ee.Classifier.smileRandomForest(10)
    .train({
      features: training,
      classProperty: 'Land_Cover_Type_1',
      inputProperties: ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7']
    });

// Classify the input imagery.
var classified = input.classify(classifier);

// Get a confusion matrix representing resubstitution accuracy.
var trainAccuracy = classifier.confusionMatrix();
print('Resubstitution error matrix: ', trainAccuracy);

However, I can't seem to find information on assessing the accuracy of regression output models in Google Earth Engine, such as ee.Classifier.libsvm.

Question
How do I conduct accuracy assessment in Earth Engine for regression models? Example:
var classifier = ee.Classifier.libsvm({
    svmType: "EPSILON_SVR",
    kernelType: "POLY",
    shrinking: true,
    degree: 3,
    cost: 1,
    terminationEpsilon: 0.001,
    lossEpsilon: 0.1})
  .setOutputMode("REGRESSION")


texts:
I'm trying to export all objects of East Kazakhstan region(as in image) from OSM file into separate pbf/osm file. What I'm trying to do is extract data from kazakhstan-latest.osm.pbf file by using osmconvert and osmfilter commands, but seems like it doesn't do what I would like to get.

After running the command:

./osmfilter kaz.o5m --verbose --keep="admin_level=4 and name=Восточно-Казахстанская\ область" -o=east2.osm

I see that my extracted file is only 3.1 Mb which is definitely small for such area.

-rw------- 1 sp sp 3.1M Aug 31 16:45 east2.osm


texts: Cannot export image on Google Earth Engine

texts:
I try to get a satelital image on my google drive by using the code:

The image variable is mejorImagen, the problem is this:

Export.image.toDrive({
  image: mejorImagen,
  description: mejorImagen.date().format('yyyy-MM-dd').getInfo(),
  scale: 10,
  region: Cuadro
});

Cannot export image on Google Earth engine.

Code:

var Cuadro =
    /* color: #0b4a8b */
    /* shown: false */
    /* displayProperties: [
      {
        "type": "marker"
      },
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry({
      "type": "GeometryCollection",
      "geometries": [
        {
          "type": "Point",
          "coordinates": [
            -71.6914011142377,
            -16.572221685382196
          ]
        },
        {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -71.80297441812573,
                -16.271598607085643
              ],
              [
                -71.80297441812573,
                -16.58838812641333
              ],
              [
                -71.32232256265698,
                -16.58838812641333
              ],
              [
                -71.32232256265698,
                -16.271598607085643
              ]
            ]
          ],
          "geodesic": false,
          "evenOdd": true
        }
      ],
      "coordinates": []
    });
var image = ee.ImageCollection('COPERNICUS/S2')
//var image = ee.ImageCollection('LANDSAT/LC08/C01/T1')
//var image = ee.ImageCollection('LANDSAT/LT05/C01/T1')
.filterBounds(Cuadro)
.filterDate('2020-03-20','2020-03-24')
//La propiedad es diferente para Landsat 8 y Sentinel 2A
//sort('CLOUD_COVER');
//Esto ordena de menor a mayor, propiedad de Sentinel 2A
.sort('CLOUD_COVERAGE_ASSESSMENT');

var conteo = image.size();
print('conteo de imágenes', conteo);

var mejorImagen = ee.Image(image.first());

var mejorImagen = mejorImagen.clip(Cuadro);

print('La primera con menos nubosidad', mejorImagen);
//Convertir la lista de imagenes en una lista
var listaImagenes = image.toList(image.size());

var segundaMejorImagen = ee.Image(listaImagenes.get(1));
var terceraMejorImagen = ee.Image(listaImagenes.get(2));

print('mejorImagen', mejorImagen.get('CLOUD_COVERAGE_ASSESSMENT'));
print('segundaMejorImagen', segundaMejorImagen.get('CLOUD_COVERAGE_ASSESSMENT'));
print('terceraMejorImagen', terceraMejorImagen.get('CLOUD_COVERAGE_ASSESSMENT'));
//Verdadero color para Landsat 8 y Sentinel 2A es 4 3 2
//True color para Landsat 5 y 7 es 3 2 1
Map.addLayer(mejorImagen, {bands: ['B4', 'B3', 'B2'], max: 3000}, 'image');
var fechaAdquirida = mejorImagen.get('DATE_ACQUIRED');
print('Fecha adquirida', fechaAdquirida);
//Para sentinel 2A las bandas de 10 m son 2,3,4,8
//Para Landsat 8 las bandas de 30 m son 1,2,3,4,5,6,7
//Para landsat 5 y 7 las bandas de 30 m son 1,2,3,4,5,7
//mejorImagen = mejorImagen.select(['B2','B3','B4','B8'])
mejorImagen = mejorImagen.select(['B2','B3','B4','B8']);

//Map.centerObject(mejorImagen,10);

//Export.image.toDrive({
  //  El clip define el área de interés real
    //image: mejorImagen,
    //description: 'Sentinel2A_Op_2018',
    //scale: 10,
    //region: operaciones
    //});

Export.image.toDrive({
  image: mejorImagen,
  description: mejorImagen.date().format('yyyy-MM-dd').getInfo(),
  scale: 10,
  region: Cuadro
});

Error:

  Error: GeometryConstructors.MultiGeometry: Geometry coordinate
  projection requires non-zero maxError


texts: Newbie GIS user here. Basic question about getting my raster (DEM) to align with my basemap. I've read similar threads but none of them make sense to me. In short, I have added a bing aerial layer in QGIS 2.10.1 and want to overlay four raster files. I can't get them to align properly, with the DEMs currently floating off the coast of West Africa. I've assigned the CRS for the project as WGS 84 / Pseudo Mercator, but can someone give me a guide on reprojecting the raster data to match the basemap.


texts: Cluster and Outlier Analysis for binary logistic regression

texts:
I am running a fairly simple Cluster and Outlier analysis.
Do I have to include the outliers that meet my pvalue criteria of 0.01 in my binary log regression?
Can I just analyze the HH and LL?


texts: How to use ArcGIS JavaScript API's map.centerAndZoom()?

texts:
I'm trying to get the map to move and zoom in to a point when a function is executed. Point gets selected, but without zoom. Interestingly when I zoom in to a random location and then execute the method I'll get zoomed out a bit and moved to correct position.

drawPointToMap(true);

Code:

function drawPointToMap(zoom) {
var lat = $('#id_latitude').val();
var lon = $('#id_longitude').val();

if (lat != '' && lon != '' && !isNaN(lat) && !isNaN(lon)) {
    try {
        var point = new esri.geometry.Point({
            latitude: lat,
            longitude: lon
        });
        mapHandler.drawToMap(point);
        if (zoom) {
            console.log('center and ZOOM');
            mapHandler.map.centerAndZoom(point, 10);
        } else {
            mapHandler.map.centerAt(point);
        }
    } catch(err) {}
}

}

Console prints 'center and ZOOM' as expected, but doesn't actually zoom. I'm displaying a WMS layer without a basemap.


texts: Creating shapefile from file with coordinates

texts: How can I make a shapefile of an CSV file with coordinates?


texts:
QGIS Desktop 3.6.2.
PostgreSQL/postGIS: PostgreSQL 10.5 on Windows x86-64
Server hosting PostgreSQL: Windows Server 2012 R2
Android on Nokia 6.1
QField App
QGIS Plugins: QFieldSync

I'm trying to save points from a QField project to my PostgreSQL Database.

However, as of now I have only been able to obtain a geopackage format of my points (offline and online). In several posts I found though that it would be possible to have the points transferred into the PostgreSQL directly from the device (in the online mode of QField).

I prepared a QGIS Project and loaded a PostgreSQL table. I set this up as a portable project in Set-tings (set paths to "relative"), packaged in the QFieldSync and transferred to the "An-droid/datach.opengis.qfield/files" folder on my mobile device.

The PostGIS table was added to the project as a new PostGIS layer in the Data Source Manager
Settings: (SSL mode "prefer"/ "Allow saving/loading QGIS projects in the database"/ password and username saved).

On my device (online and offline) points were added to the .qgs project.  The points were transferred back to my desktop by connecting the phone to the computer and using the QFieldSync plugin to synchronize the folder (ideally I'd want the points to be synchronized without connecting the phone by cable).

What I suspect is that the 'packaging' step in QFieldSync creates the gpkg file to make the Post-greSQL table editable in QField.
What settings in QFieldSync I should use for this or am I missing a step?


texts: Extract subtype codes and descriptions in a view

texts:
I have an Oracle 10.7.1 geodatabase that has tables and feature classes with subtypes.

How can I extract the codes and descriptions from the subtypes in a view?


texts: Auto Update from Google Sheets to Google Maps Engine?

texts:
I have been looking into the Google Maps Engine and I have noticed that you can import data (points) based on a Google Sheets.

This got me thinking, could this be used as a way to auto update a webmap?

From a quick test it seems like the import creates an embedded file, and looses the link to the sheet.

Has anyone looked at the option of using Google Sheets with Maps Engine as a system for adding data to a sheet, and seeing the live update on the map?


texts: Display Mouse Position OpenLayers in Custom Projection

texts:
Being extremely new to this I am trying to build a fully functioning map from scratch using OL3 have tried to work this out myself but I just can't get it to work I always seem to get the ESPG 3857 coordinates.

I have imported the proj4:

proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
    '+x_0=400000 +y_0=-100000 +ellps=airy ' +
    '+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
    '+units=m +no_defs');

And below is the following code for the map and control

var scaleLineControl = new ol.control.ScaleLine(); //Invokes ScaleLine API
var coordinatesDisplay = new ol.control.MousePosition({projection: ol.proj.get('EPSG:27700')})

//Renders the Map at Herefordshire and restricts viewable area to hereford.
var map = new ol.Map({
      controls: ol.control.defaults({}).extend([
            scaleLineControl,           // Scale Line Added here.
            coordinatesDisplay]),   // Coordinates Added here.
      target: 'map',
      renderer: 'canvas',
      layers: layersList,

      view: new ol.View({
      extent:[-349756.37790501, 6768714.96232547, -260261.2794960649, 6871952.667286136],
      maxZoom: 20,
      minZoom: 10
      })
    });

map.getView().fit([-349756.37790501, 6768714.96232547, -260261.2794960649, 6871952.667286136], map.getSize()); // End of Map Render


texts: Understanding what the Min/Max commands in QGIS raster calculator do?

texts:
I understand the examples on the official QGIS page showing bracketed expressions result in 0 or 1 and those integers can be scaled or values added, but I clearly do not understand how to use the MIN and MAX values and every attempt crashes.

I want to "clip" grid values by setting grid values < 1% of the value to that 1% value. I also want to do the same with those above 99%.

I try

(grid < (MAX (grid) - MIN(grid) /100) ) * (MAX (grid) - MIN(grid) / 100)

but this crashes QGIS.

Is this possible? If other commands change every cell, what are MIN and MAX actually doing?

QGIS Raster Calculator page: https://docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/raster_calculator.html


texts:
I'm trying to plot all rivers in the Iberian Peninsula as can be seen on the image, but the shapefile includes the Canary Islands and info about Northern Africa. To plot it I used:
library(sf)
library(tidyverse)
rios <- st_read("/Users/JMFR/Downloads/BCN500/BCN500_0301L_HIDROGRAFIA.shp")
ggplot() +
  borders("world", c("spain", "portugal"), fill = "lightsteelblue") +
  geom_sf(data = rios)

The shape file can be downloaded from https://www.dropbox.com/s/gqoz9xppf4bjwt2/bcn500_0301l_hidrografia.shp?dl=0

I can delete all North Africa info with
rios <- rios %>%
  drop_na()

I've tried to use
rios <- st_crop(rios, c(xmin= -9.80, ymin = 27.68933, xmax = 4.837648, ymax = 35.95))

But what I got was just a few rivers from North Africa, as the plot shows.

But I don't know how to delete all info from Canary Islands. My final goal is this plot north of lat. 35.95 and up to long -9.80 so I can get something as this image it is the same that from the red square).

Any suggestions?


texts: How to perform a true GIS clip of polygons layer using a polygon layer in R?

texts:
I would like to do a true GIS Clip in R of soils polygons using a series of single boundary polygons, but I cannot find an R function to properly do it. It should work just like the clip function in ESRI's ArcMap. I've tried the over method in sp package but it doesn't seem to work for polys over polys.

One suggestion was to use the gIntersection in rgeos package as a clip using the following code:

#------------------------------------
library(rgeos)
library(maptools)

#Read layers as SpatialPolygonsDataFrame (both the same Albers projection)
Soils_poly = readShapePoly("Soils_polygons")  #Note - Has 400 polygons
clipper_poly = readShapePoly("clipper_polygon")  #Note - Has 1 polygon

#Try gintersection as clip
Clipped_polys = gIntersection(Clipper_Tile_poly, Soils_poly)

#-----------------------------------

This takes 5 minutes to run (way too slow) and errors with this:

  Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, "rgeos_intersection") :
    TopologyException: no outgoing dirEdge found at -721459.77681285271 2009506.5980877089

I also tried this code to check for overlap:

gIntersects(Clipper_Tile_poly, Soils_poly)

and the result was TRUE. clip function in ESRI ArcMap works fine for this data.

Anyone knows of an R function to properly do a clip on spatial polygons using spatial polygons?


texts: Error with brush style while working with Qgis2leaf

texts:
I am getting following error while working with QGIS2leaf. it saying that QgsSimpleLineSymbolLayerV2' object has no attribute 'brushStyle'. I didn't understand why its coming . Full error what i am getting are as below

An error has occured while executing Python code:

AttributeError: 'QgsSimpleLineSymbolLayerV2' object has no attribute 'brushStyle'
Traceback (most recent call last):
  File "C:/Users/patwardhan/.qgis2/python/plugins\qgis2leaf\qgis2leafdialog.py", line 297, in export2leaf
    qgis2leaf_exec(self.outFileName, self.basemapName, self.basemapMeta, self.basemapAddress, self.width, self.height, self.extent, self.full_screen, self.layer_list, self.visible, self.opacity, self.encode2JSON,self.createcluster, self.webpage_name, self.webmap_head,self.webmap_subhead, self.legend,self.locate,self.address, self.precision, self.labels, self.labelshover, self.matchCRS, self.selected)
  File "C:/Users/patwardhan/.qgis2/python/plugins\qgis2leaf\qgis2leaf_exec.py", line 468, in qgis2leaf_exec
    if symbol.symbolLayer(0).brushStyle() == 0:
AttributeError: 'QgsSimpleLineSymbolLayerV2' object has no attribute 'brushStyle'

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.12.0-Lyon Lyon, cd9d645


texts: Get all points from pointcloud where pointcloud is new Potree.PointCloudOctree(geometry)

texts:
I use potree to view my model I want to get list of all points in pointcloud to add event to each point depending on its index. Can I get list of all points without using measurement tools?

Potree.loadPointCloud(cloudPointsPath, "name", e => {
                var pointcloud = e.pointcloud;
                var material = pointcloud.material;
                viewer.scene.addPointCloud(pointcloud);
                material.pointColorType = Potree.PointColorType.RGB;
                material.size = 1;
                material.pointSizeType = Potree.PointSizeType.FIXED;
                material.shape = Potree.PointShape.PARABOLOI;
                viewer.fitToScreen();
            });


texts: Qgis feature count increases at save layer edits

texts:
QGIS (2.12.3, running on Windows) increases the feature count of a vector layer when I "save layer edits".

If I do the following steps:

create a Vector layer (shp file)
enable "show feature count" for that layer
add a single line: feature count goes to "1"
Use "split features" to make it into two features: feature count goes to "2"
use "merge selected features"to make it one feature again: feature count goes back to "1".
do a "save layer edits": feature count now jumps to "3".

It's the last jump to "3" I don't understand. I would assume that simply saving my edits shouldn't change the feature count, and I don't understand why "3".

If I move the lines around a bit after the split but before the merge and look at the final result with other tools (e.g. geoserver), it appears that there are indeed interim results in the file.

Is this a bug or is it another issue perhaps, what's going on?


texts:
I'm doing an internship, and they want me to organize their data. I decided to do a script that would create the folders based on user input and stuff so once I'm gone they'll still be able to use it. Everything works really well until I get to maps.  I get error messages, as seen at the bottom of the code. I'd like to have the folder created be the area the map is saved to. It's been a year since I took Python for GIS so I'm a little bit rusty and I can't quite figure out what the problem is.

Could I get some help figuring out exactly what I'm doing wrong?

I've also tried replacing folder in the .saveACopy with (folder_location+folder_name). The process runs, but no map shows up.

import arcpy,os

# Create a folder and geodatabase
#local variables
folder_location= raw_input("please write where you want the folder to be.")
folder_name=raw_input("Please name your folder.")

folder=arcpy.CreateFolder_management(folder_location,folder_name)
##Create GDB:

# Set local variables

out_name = raw_input("Please choose a name for your GeoDataBase.")

# Execute CreateFileGDB
arcpy.CreateFileGDB_management(folder, out_name)
mxdname=raw_input("Please create a map name.")
#Choose the mxd
mxd=arcpy.mapping.MapDocument(r"z:/MaryGIS/Testmap.mxd")
mxd.saveACopy( folder + mxdname+".mxd")

The error I get is:
Traceback (most recent call last):
  File "Z:/Python labs/CreatefileGDB.py", line 24, in
    mxd.saveACopy( folder+mxdname+".mxd")
TypeError: unsupported operand type(s) for +: 'Result' and 'str'


texts: Creating a reminder for field staff to rename photo attachments in ArcGIS Collector

texts: It saves a ton of time in the office when field staff rename photo attachments directly in Collector. However, they have to remember to click on each photo and to rename it, and it's not obvious whether a photo has already been renamed, so it's often forgotten. I've thought about adding a hint to whatever the first field is that reminds staff to rename any photo attachments, but I was wondering if anyone knew of a good way to do this?


texts: Using multivalue output parameter with ArcPy?

texts:
How can I use a multivalue output parameter with ArcPy?

Please give an example.


texts: how to make clusters from small polygons with constraint of boundary touching?

texts: I want to make  some clusters from a bunch of  small polygons  with the constraint that each basic unit (polygon) in the resultant cluster must share a portion of its boundary  with at least one other basic unit (polygon) in the same cluster. This is becuase of the reason that i want the resultant clusters contagious.


texts:
I want to do a web project with OpenLayers 4 to show what I´ve learn at work about web mapping and OL4 (at work we use mapserver with PostgresSQL) but I want to do something basic and with a static website, no backend.

Anyone know of some API that offers WMS, WMTS or TILE for free compatible with OpenLayers 4?

I've found some articles but out of date, in my search, I found this 2 company that seems offers the product I need:

https://www.mapbox.com/

https://www.ordnancesurvey.co.uk/business-and-government/products/os-openspace/api/

But I don´t understand if they are OL compatible and if they are totally free.

Some advice?


texts: Is is possible to import PostGIS functions from another database?

texts:
Seeing that I can't find the question asked here before, I have a feeling that I'm doing something wrong!

However, here is my problem: I have one PostGIS database with 525 functions, and one with none. Is there a way to import the 525 functions from one into the other? Or should I have used the one with 525 functions as a template?

Thanks


texts:
I just upgraded to 2.4

I have noticed that when I export as an svg, for opening in illustrator, the line/pen/border widths are coming out all different.

For example a line width of 0.25 in QGIS is coming out larger than 1 in illustrator.

Before the difference was only about 0.01 so not really noticable.

My border widths are in millimeters.

Has anyone else had this problem or know how to remedy it?


texts: OpenLayers - URL hyperlink in GetFeatureInfo table?

texts:
I am serving numerous WMS layers through GeoServer, many of which have URLs leading to extended data for any particular feature embedded in their attribute table.  The URL, if present, is always contained within a column titled 'url' (for QGIS purposes).

During a GetFeatureInfo request served through OpenLayers, which returns the table of information in question, is it possible to have a URL 'hyperlink' and open a new browser tab?


texts: Open .gdb files using Python Script or By ogr2ogr

texts:
I have data which basically looks like this.

How can I extract that into csv or text format? So that I can dump that into a certain database.
Tried a lot of times but always get the error like this - "Unable to open datasource" with following error:
Python script or Ogr2Ogr command helps a lot.


texts: How to average a set of n rasters using gdal or other GRASS module?

texts: I need to average a set of n rasters using gdal or some other GRASS module. What command exists for this purpose?


texts: Hiding specific icons/markers on text generated vector layer

texts:
I'm displaying a vector layer with pois, generated from a text file:

lat lon icon    iconSize    iconOffset  title   description
56.030325   14.4774116666667    http://www.medinsbiologi.se/hano/Foto.png       -10.5,-25   102_1   UV-foto

Code to draw layer:

        var pois = new OpenLayers.Layer.Vector("Provpunkter",
        {
        projection: map.displayProjection,
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol:   new OpenLayers.Protocol.HTTP(
            {
            url:        "../poi/DynPOIHano.txt",
            format:     new OpenLayers.Format.Text(
                {
                extractStyles: true,
                extractAttributes: true
                })
            })
        });

The layer shows up fine, and I have added descriptions to each poi. Now I'd like to be able to hide some of these markers depending on icon type, with a button somewhere else on the page. I've tried using features.style:

function hideFeatures() {
    var features = pois.features;
    for( var i = 0; i < features.length; i++ ) {
    features.style.display = 'none';
    }
    pois.redraw();
    }

but I don't seem to be able to identify the layers icons. Are they considered features, icons or markers? I know this can be done with the built-in OpenLayers.Control.LayerSwitcher() and by adding multiple layers, but would like to avoid that approach.


texts: Online GIS app that allows users to log points

texts:
I am developing a website for a dolphin volunteer group, on this website they want a system to let volunteers and the public log sightings against a map and add some comments.

I have made a system using the google maps API and a database, which does the job but will need more work. I was just wondering if there is a web based, simple GIS framework that would do the same thing?

They are just using it to gather data for research purposes, so something open-source or freely useable for this purpose would be what we are after.


texts:
I am using QGIS 3.8 MacOS.

I know that prior releases of QGIS (2.x releases) did not include drivers to connect to Oracle databases, and one would need to compile QGIS themselves with the proper Oracle drivers included if they needed to connect to Oracle.

Now that there are "Official All-in-one, signed installers" for macOS have Oracle drivers been included (or are they not allowed due to licensing or some other reason)?

Changing our corporate culture to think of using QGIS before reaching for an Esri license is very challenging if we cannot connect to our spatial databases from all platforms.


texts:
If I have census data with TigerGIS/PostGIS is it possible to get back all of the long/lat coordinates for the certain census tract? I want someone to be able to type in an address or census tract, and have it draw a shape on Google Maps around the corresponding census tract.

If I understood this correctly, Google Maps can highlight regions (draw shapes on the map) if I feed it a set of long/lat coordinates? I just need one census tract to be displayed.

Would that be the right line of thinking for solving this? Any suggestions to do something like this?


texts:
I'm quite new to QGIS, but with QGIS 2.18.3 64 Bit @ Windows 7, I managed to set up a European map with a bar chart overlay.
However, it doesn't look neither very nice nor professional, as there are some charts overlaying each other and, what's worse, overlaying the country shortname, please see screenshot attached.

Moreover, I want to add the values to the created bars - is there a way how I can do it?
If that's not possible with the built-in methods, is there any plugin you can recommend for doing so?


texts: ModisDownload - doubts when using MRT tool

texts:
I am using the incredible MODISDownload function from the rts package in R to download NDVI data on vegetation index in Africa.

I have two questions.

I am using the latest version of the package available on github, and I download and reproject the images with the following code (which works beautifully):

ModisDownload(x=x,h=c(19),v=c(5), version = '006', dates=c('2000.01.01', '2000.02.28'),
              MRTpath=path,mosaic=F,proj=T, bands_subset="1 0 0 0 0 0",
              proj_type="GEO",proj_params="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0",
              datum="WGS84",pixel_size=0.001)

where x = "MOD13Q1" and path is the path to my MRT/bin folder. I choose only band 1 because I am interested in the NDVI index, which is the first band. I choose proj_type = "GEO" as I want the projection on longitude/latitude format.

I am not very sure about my choice of the proj_params and pixel_size parameter. For the former, I mimic what is automatically set if I do the reprojection using the MRT GUI interface, but I am not sure whether that is correct.

For the pixel_size, though, I am completely lost. It is clear that the smallest its values, the higher the resolution of the outcome tif file. However, the higher will the its size on disk. Thus, I was wondering whether someone would know how can I calculate an 'optimal' pixel size for the 250m resolution.


texts: Why does converting the_geom into lat/long gives me more than 1 coordinate?

texts:
I'm converting my the_geom into lat/long coordinates but I only want a single coordinate since I'm gonna use the coordinates to draw a polyline in google maps.
Attached is the picture of the result of my query.


texts: Fix export to include character strings with accents (French text) in shapefile when using writeOGR in R

texts:
I have a SpatialPolygonsDataFrame in R that I want to export to shapefile.  I used writeOGR to export but the cells with that contain text values with accents (é, è, à, ê, etc) are blank. When I export only the data slot as a csv file, the values are preserved.

I have used the following when exporting:

writeOGR(obj=for.ana, dsn=".", layer="for_export",driver="ESRI Shapefile", encoding="UTF-8")

When I want to import a similar shapefile with French accents, I use the following code that works:

readOGR(".","file", use_iconv=TRUE, encoding="UTF-8")

What is the equivalent code for exporting?


texts: Snap points to route and calculate relative length from start

texts:
Input:

Points layer points spread around some route
Route layer route where each route link is feature of type Multi Linestring. However it's possible to merge it to single feature layer of type Multi Linestring using Qgis GUI Merge Lines tool (I haven't succeed to merge to single feature of type Linestring-this is important later on)

What I want to calculate:

Snap each point to the route with a length field indicating length distance along the route from the beginning of the route (and not beginning of the nearest route link etc.).

What I tried:

Using PostGis I tried

ST_Line_Locate_Point(ST_MakeLine(route.geom), points.geom)

I need ST_MakeLine to form single LineString (as I said it's a Multi Linestring), The problem is that ST_Line_Locate_Point  still returns the error "first argument isn't Line", so I don't know whats going on here.

Searched in all Qgis tool box for appropriate methods - haven't found one.
Tried LRS plugin - seems not relevant for this use case.


texts: Labeling 2 different fields, stacked, with different fonts and colors

texts:
I'm using ArcGIS 10.6
I'm wanting to label some points features with the landing number and corresponding number of loads (I work in forest restoration).  I want them to be stacked and have different symbology.
For example, if landing 13.12 has 4 loads, I want it to be labeled something like this:
13.12 (in black)
(4) (in red)
I have something like the following from another post but I don't know how to change the text color or add italics:
def FindLabel ( [Name], [Loads] ):
  if  ([Name]) == "":
return [Name] + "\n" + "(" + [Loads] + ")"
  else:
    return ""


texts: Getting map center lat long in ArcGIS API for JavaScript?

texts:
How to get map center lat long in arcgis javascript api?

I looked the api reference of 'Map' object, only see map.getZoom()

There is NO such method map.getCenter()


texts:
I have tested with point and polygon layer. I get no terrain altitude binding.  I use for the project and for the layer crs WGS 84 / UTM zone 32N (32632). Screenshot example with point layer, cylinder. I use SRTM1 data for the terrain.
Also tested without success: altitude clamping absolute and relative.

What could I do better to get a correct result? Or is this a bug within QGIS?

QGIS 3.10.5, Windows 10

This is want I want (black cylinders):


texts:
I am trying to clip a raster image based on a vector mask layer and I am encountering this error: Gdal format command not found.

I am on a Macintosh and my QGIS version is 3.4.


texts:
I am trying to re design a plugin to run multiple iterations of data loaded from a file. I am using QT creator to develop the GUI. How would I design a load data input box so users can select a data file and then run the plugin.

The plugin initially uses single coordinate inputs i wish to use multiple.


texts: plug logistic regression equation into Raster Calculator when one predictor is nominal

texts:
I am conducting a study that aims at building a Logistic Regression model for land productivity quality (binary dependent variable: good, no good) using different predictors such as slope, elevation, aspect, distance from coast-line, soil types, etc.

Once I have got my Logistic Regression equation, to get a raster depicting the land productivity quality probability, I have plug into ArcGIS's (10.1)'s Raster Calculator the logistic regression equation. So far so good.

On that respect, I have found a discussion (http://forums.esri.com/Thread.asp?c=93&f=993&t=270065) in which an example has been provided of the formula to put into the Raster Calculator. For example,
1.0 / (1.0 + Exp( 1.0 - 2.5 * [slope] ))
where the third 1.0 is the constant, and -2.5 is the coefficient for the slope, and the [slope] is the slope raster.

Now, one of my predictors is nominal, i.e. soil types.  It has been derived from a feature class where polygons where used to chart the different soil types.
So, my logistic regression equation would run as follows:
1.0 / (1.0 + Exp( 1.0 - 2.5 * [slope] + 1.4 * [sandy] ))
where 'sandy' is one of the categories making up the 'soil types' raster.

The problem for me is: how can I plug the 'soil types' raster into the logistic regression formula to be used in the Raster Calculator? I mean, how can ArcGIS multiply a nominal value (i.e., sandy) by 1.4.


texts: Qt folder browser opening more than once in QGIS plugin

texts:
I have a Qt plugin, and i have a button browse_btn to browse for an output folder.
I use the QFileDialog.getExistingDirectory function and it all works fine. However if I close the plugin and open it again, then click the pushbutton to add a path, the opened window for choosing the path will re-open after I choose a path or close it. If I close the plugin a open it again the 'choose path' window will reopen 3 time and so on...

The similar problem is still open here and in comments here and probably solved here, but since there is no code provided I cannot apply it to solve my problem.

The exact code is following:

self.dlg.browse_btn.clicked.connect(self.set_output)

def set_output(self):
    folder_path = str(QFileDialog.getExistingDirectory(self.dlg, u"Pick a folder"))
    if not folder_path:
        return None

I think this happens because each time I open-close the plugin the separate connection is created with self.dlg.browse_btn.clicked.connect(self.set_output), and it only disconnects after I relaunch QGIS or use Plugin Reloader


texts: Why am I getting a straight flow path (stream) in obviously varying terrain -QGIS

texts: Does anyone have suggestions on why the streams are sometimes represented as longer straight lines, even though the hillshade and contours generated from the same DTM (filled) clearly indicate that the watercourse should be both elsewhere and meandering (it is correct on much of the network, but some stretches are clearly wrong for lengths even up to 1 km).


texts: Analyzing differences between two shapefiles to put results into new shapefile using ArcMap

texts:
I have two polygon shapefiles of the same region from two different years (1985 and 1997) and I need to analyse the differences between the two shapefiles resulting in a third polygon shapefile displaying only differences.
The shapefiles cover an inner-city area with buildings, parks, sealed/unsealed areas and water areas. I need to find out for example if a building was de-/constructed or if a park was moved or closed or similar things. Any differences between the shapes.
I need the output to be in a third, new shapefile.
Is there an automated way to achieve this?
I am working with the proprietary file geodatabase in ArcGIS 10.1, so I'd prefer solutions in ArcMap.
I thought it might be possible to work with topology analysis in ArcGIS but I'm not quite sure for example how to compare shapes by attributes: Each shape has a field "type" in the attribute table and I need to compare not only the shapes but the types of the polygons.
Note, Finding differences between shapefiles using ArcGIS for Desktop? sounds similar, but I'm looking for an output in a polygon shapefile format.
This is a change detection process on vector data (no remote sensing issue). There are some nice comments in this answer but no solutions at all.


texts:
I am trying to install QGIS (any version) on Ubuntu 16.04 and Python 2.7 or Python 3.7.2

I run the
sudo apt-get install qgis python-qgis qgis-plugin-grass saga and I get :

Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-qgis : Depends: python-qgis-common (= 1:2.18.16+20trusty) but it is not going to be installed
               Depends: libqgispython2.18.16 but it is not going to be installed
               Depends: libqgis-analysis2.18.16 but it is not going to be installed
               Depends: libqgis-core2.18.16 but it is not going to be installed
               Depends: libqgis-gui2.18.16 but it is not going to be installed
               Depends: libqgis-networkanalysis2.18.16 but it is not going to be installed
               Depends: libqgis-server2.18.16 but it is not going to be installed
               Recommends: liblwgeom-dev but it is not going to be installed
 qgis : Depends: libgdal1h (>= 1.8.0) but it is not installable
        Depends: libgeos-c1 (>= 3.4.2) but it is not installable
        Depends: libgsl0ldbl (>= 1.9) but it is not installable
        Depends: libqgis-analysis2.18.16 but it is not going to be installed
        Depends: libqgis-app2.18.16 but it is not going to be installed
        Depends: libqgis-core2.18.16 but it is not going to be installed
        Depends: libqgis-gui2.18.16 but it is not going to be installed
        Depends: libqgis-networkanalysis2.18.16 but it is not going to be installed
        Depends: qgis-providers (= 1:2.18.16+20trusty) but it is not going to be installed
        Recommends: qgis-provider-grass but it is not going to be installed
 qgis-plugin-grass : Depends: qgis-provider-grass (= 1:2.18.16+20trusty) but it is not going to be installed
                     Depends: libgdal1h (>= 1.8.0) but it is not installable
                     Depends: libqgis-app2.18.16 but it is not going to be installed
                     Depends: libqgis-core2.18.16 but it is not going to be installed
                     Depends: libqgis-gui2.18.16 but it is not going to be installed
                     Depends: libqgisgrass6-2.18.16 but it is not going to be installed
                     Depends: grass-core but it is not going to be installed
                     Depends: grass643 but it is not installable
 saga : Depends: saga-common (= 2.3.1+dfsg-3~ubuntugis~xenial2) but 2.3.1+dfsg-3~ubuntugis~xenial6 is to be installed
        Depends: gdal-abi-2-1-3
E: Unable to correct problems, you have held broken packages.

How do I fix this?


texts:
I am customizing an ATLAS in QGIS and I would like to insert a table frame to introduce all attributes belonging to one feature. I have seen it is possible to add the attribute table but for my project, each sheet will be filled with the date from one feature (one row), I have noticed, I could perform this using just labels but I see this solution a bit tedious.
Does anyone know a better way to do that?


texts: Mapping parliamentary results (categorical data) by share of polygon in QGIS

texts:
I'm trying to recreate the fill effect in this map: Where each polygon is filled based on the percentage of vote each parliamentary party gained. The author wrote "I converted the inner polygons into raster data format and applied a pixel-counting technique to create subdivisions of accurate size." Source

I'm hoping to do this with QGIS, I have polygons with the number of votes each party has gotten in a different election. I can convert them to raster polygons, but I'm not sure how to color them and achieve the "stripe" effect.

Also I believe this data is "categorical" but correct me if there is a different term I should be using.


texts: "Oddities" in the Shapefile technical specification

texts:
I've been writing a shapefile parsing library, and have encountered a couple of design decisions in the specification that I don't immediately understand.  I'm hoping there's a wizened old ESRI developer around here who can tell me why these things are the way they are.

The main record file (.shp) is of mixed endianness.  Specifically, parts of the header features big endian byte ordering, but the records are all little endian.  I typically work at a higher level than bytes and bits, but everything I've so far read about endianness marks this as unusual.  Why isn't the file specified to be of uniform endianness?

The "File Length" field, as well as other length and position fields, are recorded in 16-bit words, instead of the more standard (from my limited perspective) 8 bit positioning.  How did this decision get reached?

I posted a similar question on Stack Overflow, but didn't get any response.  If this seems too off topic to other people, I could support closing it.


texts: Runtime error : ERROR 000358: Invalid expression using SelectLayerByAttribute in ArcPy?

texts:
I cannot for the life of me persuade SelectLayerByAttribute to work (I need to automate this for a complex script).  Working in ArcMap's python console on already loaded shapefile, the format below:

import arcpy
from arcpy import env
arcpy.env.workspace = r"C:/Users/.../working"
arcpy.SelectLayerByAttribute_management("layer", "NEW_SELECTION", " 'ATTRIBUTE' = 'Criterion' ")

results in error:

  Runtime error : ERROR 000358:
  Invalid expression Failed to execute (SelectLayerByAttribute).

An alternative method:

import arcgisscripting
import arcpy
gp = arcgisscripting.create(9.3)
gp.workspace = "C://...//working"
sFile = "C://...//working//shapefile.shp"
lyr = "layer"
gp.makefeatureLayer_management(sFile, lyr)
gp.toolbox = "management"
gp.SelectLayerByAttribute("layer", "NEW_SELECTION", " 'ATTRIBUTE' = 'Criterion' ")

.. selects everything, including features that don't meet the criterion!

Does anyone have any idea what's going wrong?  I've read some pages on this problem, but found no solution that works here. The working directory is correct. The attribute field and criterion are correctly specified (case sensitive etc), etc. Its very confusing.


texts: How to transform a set of street-segments into city-blocks, with PostGIS2?

texts:
Theoretically is possible to obtain the polygons of city blocks (urban blocks)  from streets, when streets are represented by street axis (LineStrings).

The urban blocks are bounded by streets, so the street segments can be used to form a polygon which contains only one block inside... See illustrations.

There are an (SQL) PostGIS 2.X script to do this? A plugin software? PS: approximate city block geometries are enough.

Illustrating

Starting the process from a "mesh of connected line segments", it can be: 1)  obtain associated polygons; 2) isolate polygons by negative buffer and buffer subtraction of the lines.

Example: the polygon 262 (representing a city block) was originated by the segments 2496, 2494, 2369, 1513, ... And the neighbor polygon 263 can use some common segments, but next (by negative st_buffer or another operation) will be really isolated polygons, so, low precision  is enough.

(EDIT)

I think we can translate this specific problem in a more generic one: the set of street segments can be viewed as a kind of
tessellation, that is, the segments separe the plane into contiguous regions
– the urban blocks are lying in the interior of these regions. Each segment is a side of two regions.

The main problem is to transform the "set of segments of the tessellation" into independent polygons.


texts: Mask rasterio raster with geopandas shapefile

texts:
I am loading a shapefile using geopandas as follows:

import geopandas as gpd
StudyA = gpd.read_file('.../Study_Area_Polygon.shp')

Next, I am using folium to plot it interactively:

m = folium.Map([36.43, 43.06], zoom_start=12)
folium.GeoJson(StudyA).add_to(m)
m

My objective is now to use rasterio to mask a raster using the shapefile I have loaded before with the following code:

img, out_transform = rasterio.mask.mask(img, StudyA, crop=True, all_touched=True)

However, I am facing an issue as the information of the mask should be provided as a list of GeoJSON-like dicts according to rasterio documentation. How can I produce that GeoJSON-like dicts when reading the shapefile with geopandas.

Previously, I was reading the shp using the following code and it worked well. The issue is that I want/need to use geopandas for interactive plotting with folium

with fiona.open(".../Study_Area_Polygon.shp", "r") as StudyArea:
    shape = [feature["geometry"] for feature in StudyArea]


texts: Displaying dart (leader) on Callout text symbol inserted into ArcGIS Pro Layout

texts:
This procedure can be followed to see where I am stuck when trying to use the Callout (San Serif) text symbol of ArcGIS Pro:

Start ArcGIS Pro 2.5.0 and create a new Project using any Template (I used Map)
Insert a Layout using any page size
On the page use the Insert ribbon to click on the Symbol button in the Text group and in the gallery choose Callout (Sans Serif) from the Layout category
Use the Rectangle Text tool to drag out a rectangle for the callout text symbol
In the Element pane you should see Format Text as its heading, so switch to the Text Symbol tab and then to its Properties tab.  You should see something like this:

Under Appearance change the font Size to be 48 pt and then Apply.  You should see the sample text in the Element pane has a dart (leader) coming off from near its bottom left corner whereas the text on the layout does not:

How do I get the text element just created to have a dart leading off it too?

I suspect that it may be under Callout (see below) where the Dart Symbol has an Outline width of 0 pt but I have not been able to change that from being grayed out.  I have also tried ticking the Fixed Dart Width checkbox so that I can increase it from 7 pt to 100 pt as a test.  Neither helped.


texts: ArcGIS Attribute table add field and summarize certain categories?

texts:
I try to summarize CorineLandCover12-classes together to a higher level into a new column.

For example: 1.1.1 continous urban fabric plus 1.1.2 discontinous urban fabric should become 1.1 Urban fabric in a new column.

I added the new column but got no clue how to add an query as an VB script.

Can it be something like this:

If 'code12' = 111 or 'code12' = 112
then "name it" '1.1' or "no input as I have to do the same with other landuse classes"

Any ideas?


texts: Rotation by attribute in Geoserver SLD style

texts:
I have a table with field calculated by function:

   NEW."rotationAngle" := degrees(
                         ST_Azimuth(
                            ST_StartPoint(NEW.the_geom)
                          , ST_EndPoint(NEW.the_geom)
                         )
                      ) - 90;

Now i publish this table as Geoserver layer and set style with Roataion tag:

  <Rule>
    <TextSymbolizer>
      <Geometry>
        <ogc:Function name="startPoint">
          <ogc:PropertyName>the_geom</ogc:PropertyName>
        </ogc:Function>
      </Geometry>
      <Label>
        <ogc:PropertyName>annotation</ogc:PropertyName>
      </Label>
      <LabelPlacement>
       <PointPlacement>
         <Rotation>
          <ogc:PropertyName>rotationAngle</ogc:PropertyName>
         </Rotation>
       </PointPlacement>
      </LabelPlacement>
      <Fill>
        <CssParameter name="fill">#FFFFFF</CssParameter>
      </Fill>
      <VendorOption name="spaceAround">10</VendorOption>
      <VendorOption name="autoWrap">85</VendorOption>
      <VendorOption name="group">yes</VendorOption>
    </TextSymbolizer>
    <LineSymbolizer>
      <Stroke>
        <CssParameter name="stroke">#000000</CssParameter>
      </Stroke>
    </LineSymbolizer>
  </Rule>

And result:

How can you see label angle not equals line angle.
When i publish table as a SQL view:

SELECT gid, annotation,"fontSize", the_geom, degrees( ST_Azimuth( ST_StartPoint(the_geom), ST_EndPoint(the_geom) ) )-90 as angle from annotations

With same style i get result:

Label angle equals line angle.
Why it's hepping? What i do wrong in first case?

UPDATE

I checked angle values in both cases and they are same.
Table's geometry have a custom projection. When i publish it on Geoserver i reproject it in EPSG:4326.

Update

I changed function to:

   NEW."rotationAngle" := degrees(
                         ST_Azimuth(
                            ST_Transform(ST_StartPoint(NEW.the_geom),4326)
                          , ST_Transform(ST_EndPoint(NEW.the_geom),4326)
                         )
                      ) - 90;

But not help.

Update
I found interesting behivor. I setted Label text as rotationAngle property and open both layers in Layers Preview and results:

View Layer:

Table Layer:

Table Layer in application (map projection EPSG:900913):

Just wft going on?

Solved

Of couse it was stupid. My application's map showed in EPSG:900913. So why i calculate rotationAngle in EPSG:4326? I dont know. This is correct function:

       NEW."rotationAngle" := degrees(
                         ST_Azimuth(
                            ST_Transform(ST_StartPoint(NEW.the_geom),900913)
                          , ST_Transform(ST_EndPoint(NEW.the_geom),900913)
                         )
                      ) - 90;


texts: Opening specific WMS layer in QGIS with single URL

texts:
Is it possible to open a specific WMS layer in QGIS directly by entering the whole URL of this WMS?

That is, without having to open a WMS connection first and selecting the layer in the tree.


texts: Why does QGIS scalebar show a wrong scale?

texts:
I'm using QGIS 1.7.1 and have added a scalebar. The scalebar usually displays in degrees, unless I switch the map's projection to meters, in which case the units are display in cm. This is not correct. Any thoughts on how I can get this in reasonable units?

Thanks!


texts: Merge Symmetrical Difference and Intersection Line

texts: I tried to merge these two types of lines I have from using the geometric tools "Intersection & Symmetrical difference".  They end up being part of the same line and I want to join them together and remain "smart" with their respective attributes.  When I try to merge them with the merge vector command I get the "All layers must have the same geometry type" syntax.  I'm wondering if there is anyway to get through this and to combine the two vectors into one.  I tried to save-as both of the vectors and then combine them that way but when I save-as the symmetrical difference vector then all unwanted vector lines come back. (Look at the second picture to further understand this).


texts:
Background:
Our group has full ESRI licenses and applications built with ArcGIS Desktop.

We are invested in the arc geodatabase itself and will not change that tier.

There is a proposal to switch from ARC applications to QGIS and QT with the use of the ESRI geodatabase.

There is a push for:

Being platform agnostic:
Issues when windows (client side) moves OS.

True separation between software tiers
- This argument is not strong for the case, as this can be accomplished in many ways. Better programming practices, policies etc.

Move away from a dependency on Microsoft:
- currently code is written mostly in VB and C++. There is some python, but not much.

The background languages here is python and C++.

Question:
Is there a benefit to making this switch? I do not believe that the licensing will change, but it can give us one source code for all platforms.

The push for the change is not due to the backend, but for the client interface and the license costs.


texts: Not able to convert GPS coordinates received from a software into Latitude and Longitude

texts:
I am working on a software which returns GPS coordinates in this format:

Lat : '48684499'
Lon : '5203474'

I can not understand what type of coordinates are these and not able to convert them into proper Latitude and Longitude like :

Lat : '-41.295929'
Long : '174.77573'


texts: How do I calculate average in my field calculator within specified limit?

texts:
I would like to calculate the average, max and min of each trips that I have. Each trips are also predefined (e.g. Trip 1, Trip 2) in the attribute table. (As below). I have more than 2000 trips.

The question I have is - how do I calculate the average, max and min speed for each trips? Do I use the field calculator? If so, how do I type my command?


texts: arcgis flex widget close a window and open another window with datagrid

texts: I uses Arcgis api for flex 3.6 and adobe flash builder 4.6. I want to develop a widget use a window (say window 1) to allow user to input searching criteria, after click "Ok", window 1 should close and another window (say window 2) should open, in window 2 display the searching results (based on window 1 user input searching criteria) in a datagrid. I wonder whether this possible to be?


texts: How are Google serving up their Styled Maps?

texts:
As we all know, Google changed web mapping when they introduced Google Maps.  At the time of writing this, tiled maps are now the norm with web mapping.

For example, with ArcGIS Server, you cache as many of your layers as possible into cached map services, and then if need be, you pull in any of your operational layers via either dynamic or feature services.

Once you have a cached service, there is no way to tweak the cartography without having to build a new cache again.

The v3 Google Maps API allows you to style the Google Tiled Basemap.  The styling wizard lets you tinker nearly all aspects of the Google Map, to suit your needs.

I can understand from an API perspective, how you can send your style request in a JSON object.

What I want to know is, how are they doing this at the back end? (Would be good to include a reference)

If I look at the Styling Wizard with Firebug, and make changes to anything, I can see that new GET requests are made to return PNG images back to the client.

There are near infinite variations you could apply, so they cannot have all the tiles pre-cooked and ready to serve out.  Therefore, I can only assume they are creating these tiles on demand?


texts: Domains not showing default values when under edit in ArcGIS Online?

texts:
I am having trouble displaying the field value when it is under edit.
I have published a Web App on my server that displays a number of fields through pop-ups on the feature layer. I've used domains with these fields to lock-in what the user can enter.

The default value does not show up where I have enabled domains. This is a bit of a problem, as the user would like to see what is already entered before they make their selection.

Is there a way to make the default value visible on-top of the domain selection, instead of it saying Keep Existing Value?

I've set up my domains using properties, feature class, and the Domain option within subtypes.


texts: Downloading GRIB GFS files with specific filters?

texts: Is it possible to download a smaller GRIB GFS file with specific parameters only (e.g. surface wind and temperature values) rather than hundreds of MB of data? If so, what is the usual approach to achieve this?


texts:
I built a Python script that downloads tiles from some map service. This service cannot be imported to QGIS as a tile layer so I decided to download tiles directly using requests module. The script also performs a georeference task that is done by SetGeoTransform method in gdal.

The service provided multiple output formats so I tested *.png, *.jpeg and *.bmp. As test shows, *.png is fastest to download and close to the best quality. *.bmp has the best quality but download time is too long.

In the end I have a set of georeferenced PNG images that need to be merged into one image file.
The problem is based on keeping oroginal color of all images.

When I load images to QGIS, their colors were presented in normal condition:

Merged them them using gdal_merge using this code:

attrs =['', '-o', 'out_file_merged.png', 'out_g_1', 'out_g_2', 'out_g_3', 'out_g_4', 'out_g_5']
gdal_merge.main(attrs)

But result was like this:

Right the only one way for me to keep colors is to download *.bmp tiles. But is it possible for gdal to operate with *.png images and keep their colors?


texts: Calculating NDVI using Landsat 8- Cloud/Atmospheric Correction

texts:
System: Windows 7

Software: Arcmap 10.4.1

Data: Landsat 8, NDVI calculations

I am attempting to calculate the NDVI values over my state over a period of 3 months. Naturally, there are going to be clouds in my image. I am aware that there are ways to correct for cloud interference (using the QA band, Fmask) but I'm not sure exactly how I should approach it. My plan was to use Landsat 8 bands 5 and 4 on their own but I'm unsure if I should apply corrections before or after calculating the NDVI. Would it be better to run corrections then the NDVI or vice versa? Does the order matter?


texts: Plotting shapes form Census Bureau with GeoPandas results in some erroneous white triangles

texts:
GeoPandas 0.6.1

Almost every shapefile from Census Bureau is giving the same error.

In this case is the Block data shapes from Maine. The file is "tl_2019_23_tabblock10.shp"

gdf.plot(figsize=(32, 16), column='INTPTLAT10', linewidth = 0)

EDIT: full code

import numpy as np
import pandas as pd
import shapefile as shp
import matplotlib.pyplot as plt
import seaborn as sns
import descartes
import geopandas as gp

from shapely.geometry import Polygon

sns.set(style="whitegrid", palette="pastel", color_codes=True)
sns.mpl.rc("figure", figsize=(10,6))
%matplotlib inline

shp_path = "./tl_2019_23_tabblock10/tl_2019_23_tabblock10.shp"
sf = shp.Reader(shp_path)

def read_shapefile(sf):

    fields = [x[0] for x in sf.fields][1:]
    records = sf.records()
    shps = [s.points for s in sf.shapes()]
    df = pd.DataFrame(columns=fields, data=records)
    df = df.assign(coords=shps)
    return df

df = read_shapefile(sf)

df.INTPTLAT10 = df.INTPTLAT10.astype(float)
df.INTPTLON10 = df.INTPTLON10.astype(float)
df.STATEFP10 = df.STATEFP10.astype(int)

df.coords = [Polygon(list(i)) for i in df.coords]
gdf = gp.GeoDataFrame(df, geometry=df.coords)

gdf.plot(figsize=(32, 16), column='INTPTLAT10', linewidth = 0)


texts: How to buffer raster pixels by their values?

texts:
The pixels to the left represent tree locations and their associated crown radii (i.e. pixel values ranging from 2 - 5).  I would like to buffer these raster pixels by their crown radius value.  The image to the right is what I am hoping to accomplish using only raster processing methods.

I would initially think to use a circular focal sum in ArcGIS, although the neighborhood setting is a fixed value, which would not take into account the variable sized crown radius.

What is a good method to "buffer" pixels by their values?


texts: How to efficiently fetch multiple ST_Value from PostGIS raster(s)

texts:
I have a raster table with index created by raster2pgsql.
I can see the best way to fetch a single point value is
SELECT ST_Value(rast, :point) FROM tbl WHERE ST_ConvexHull(rast) ~ :point;

However, given the structure and the functions I can see, it's not obvious how to best fetch e.g. 1000 point values at once. Neither from a single tile, not if they span across tiles.
I had an initial try with MULTIPOINT geometry, but they don't work with ST_Value, and I didn't know where to start with the WHERE clause.


texts: QGIS keeps crashing when exporting print layout map - how to stop this?

texts: When exporting my map which contains vector data and two maps (one as a global locator insert map) as an SVG file QGIS keeps crashing. I need the map to be exported as an SVG file as I want to edit it further in Inkscape. What could be the sources of the crashing? How can I fix this? I'm using QGIS desktop 3.10.6.


texts: Extract points automatically from GeoPDF

texts: I have a GeoPDF file which have some small icons (e.g. triangle, small man, small boat, circle, and so on..). I need to extract these icons in a point shapefile - automatically. Is there any plugin or script to do this? I need to mention that I use QGIS.


texts: How to create Sequential Animation of Polylines in ArcGIS10?

texts:
I have a data set consisting of sets of polylines which reflect movement of individual organisms in my sample within their habitat each day. I am trying to create an animation which cycles through the days, displaying only the movement for one day at a time.

When I try to do this in ArcGIS10, it adds the lines from each day onto a map containing the lines from all previous days. How can I get the previous days' lines to disappear when the time slider moves to the next day?


texts: Displaying QGIS attribute table on the right

texts: Is it possible to dock QGIS attribute table on the right? I know it is possible to display it on top and bottom, but for my project it would be better to dock it on right (or left) side.


texts: Unable to create empty memory layer for Line layer using PyQGIS?

texts:
# Get the currently selected layer
inLayer = iface.activeLayer()

# Get its list of fields
inFields = inLayer.dataProvider().fields()

# Convert its geometry type enum to a string we can pass to
# QgsVectorLayer's constructor
inLayerGeometryType = ['Point','Line','Polygon'][inLayer.geometryType()]

# Convert its CRS to a string we can pass to QgsVectorLayer's constructor
inLayerCRS = inLayer.crs().authid()

# Make the output layer
outLayer = QgsVectorLayer(inLayerGeometryType + '?crs='+inLayerCRS, \
inLayer.name() + u'_copy', \
'memory')

# Copy the fields from the old layer into the new layer
outLayer.startEditing()
outLayer.dataProvider().addAttributes(inFields.toList())
outLayer.commitChanges()

# Add it to the map
QgsMapLayerRegistry.instance().addMapLayer(outLayer)
QgsVectorFileWriter.writeAsVectorFormat(outLayer, 'temp_Layer.shp',"utf-8", None, "ESRI Shapefile")

works with Polygon Layer and Point Layer, but in case of line layer its creating minidump!


texts: How do I append PostGIS commands to the system path?

texts:
I'd like to be able to call psql instead of having to put in the full path everytime.  I went into Environment Variables through My Computer and added the path to the semi-colon separated list, but still no luck.

I'm sure this is easy, just haven't dealt much with Windows commands.


texts:
Is there any way to add a google maps layer in a qgis web client project?

I made a qgis project using a google maps layer from OpenLayers Plugin. In
my desktop project, this layer works fine. But when I load the same
project in the qgis-web-client all my layers are loaded, except the google
maps layer.


texts: Multiple markers on Google Maps using JavaScript, PHP and SQL

texts:
I am trying to query the MySQL database that has a table with firstname, longitude, latitude in it.

I want to get the longitude and latitude and display them as multiple markers with the firstname as a description.

However, when I try to load the HTML page it comes back empty. Any ideas why?

The content of my testmap.html looks as follows

<?php $z = array();
$n=0;
$link= new mysqli('localhost','root','');
    if($link->connect_error){
        die("Connection failed:" .$link->connect_error);
    }
mysqli_select_db($link,"blood_organ_donation");
echo "DB selected successfully";
$sqlperson= "SELECT firstname,latitude,longitude
                    FROM personprofile ";
$person=  mysqli_query($link,$sqlperson);
while( $row =mysqli_fetch_array($person)){
  $y=array();

  $y[]=$row["fistname"];
  $y[]=$row["latitude"];
  $y[]=$row["longitude"];
  $z[$n]=$y;
  $n++;
 }

 ?>

<html>
<head>
<script type="text/javascript">
//var locations = <?php echo json_encode($a);?>;
var locationsb = <?php echo json_encode($z);?>;
var map = new google.maps.Map(document.getElementById('map'), {
 zoom: 6,
 center: new google.maps.LatLng(22.00, 96.00),
 mapTypeId: google.maps.MapTypeId.ROADMAP
 });

 var infowindow = new google.maps.InfoWindow();
 var image = '/marker/map.png';
 // var image2 = '/marker/Map1.png';

var marker1, n;
for (n = 0; n < locationsb.length; n++) {
marker1 = new google.maps.Marker({
position: new google.maps.LatLng(locationsb[n][1], locationsb[n][2]),
offset: '0',
icon: image2,
title: locationsb[n][4],
map: map
});
google.maps.event.addListener(marker1, 'click', (function(marker1, n)
{
return function() {
infowindow.setContent(locationsb[n][0]);
infowindow.open(map, marker1);
}
})(marker1, n));
}

</script>
<head>
<body id="map">
</body>
</html>


texts: Processing for large scale networking animation?

texts:
I am looking to create an animation of network connections, something very similar to this: http://vimeo.com/16897839. Let's say I have a huge database (millions of rows), that includes

  source location, destination location, timestamp

, and I want to create a timelapse animation of all the interactions going on, is it possible to animate this on the fly, or does it have to be saved frame by frame and then rendered into a video?

I have been playing around with Processing, and it seems that animating anything > 5000 objects, the animation becomes too laggy to view in real time.

I wanted to originally allow the viewer to select certain settings, and have the animation change depending on the filters, but I'm assuming if I have to render the image and record as video than that is not possible.


texts: Geoserver: sortBy for property named as number leads to ClassCastException

texts:
I have an SQL view layer in Geoserver, with almost all properties named as integer numbers (e.g. 76096294). When I request Geoserver's WFS to sort features by such property, it returns

  {
      "version": "2.0.0",
      "exceptions": [
          {
              "code": "NoApplicableCode",
              "locator": "noLocator",
              "text": "java.lang.ClassCastException"
          }
      ]}

My full request string looks like this

http://hostname/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeName=workspace:layer_name&outputFormat=application/json&exceptions=application/json&srsName=EPSG:3857&startIndex=0&count=20&sortBy=76096294&viewparams=register_id:76098281

But sortBy with property named as string (e.g. feature_id) works just as expected.
In geoserver logs I see just

  2018-11-09 15:52:59,381 ERROR [org.geoserver.ows] -
  java.lang.ClassCastException

Does anyone know any solution/have any suggestion how to do sort by property named as integer?


texts:
I have been getting a bit of an odd error when starting QGIS concerning the loading of one of my own plugins

Traceback (most recent call last):
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 219, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "E:\GitHub\QDriller\QDrillerPlugin\__init__.py", line 34, in classFactory
from .qdriller import QDriller
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "E:\GitHub\QDriller\QDrillerPlugin\qdriller.py", line 27, in
from qdriller_dialog import QDrillerDialog
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "E:\GitHub\QDriller\QDrillerPlugin\qdriller_dialog.py", line 417, in
os.path.dirname(__file__), 'sectionview_base.ui'))
File "G:\OSGEO4~1\apps\Python27\lib\site-packages\PyQt4\uic\__init__.py", line 213,in loadUiType
exec(code_string.getvalue(), ui_globals)
File "", line 219, in
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named resources_rc

Now usually this would be because there is a mismatch in the name of the resources module called in the main plugin module (qdriller.py).

However, i have called my resources module 'resources', both in the code and the plugin directory. All my gui elements work and the resources are present (and have been changed and recompiled since first getting the error), and the plugin runs when reactivated using the plugin manager once QGIS is running.

This error occurs regardless of what the import call/resources file are called, i have tried "resources", "resources_rc", "foobar" etc. All cause the error but in all cases the gui and resources still work

This is also the case across 3 different installs of 2.8 and 2.8.1


texts: Error when dividing a field with a number

texts:
Using arcpy CalculateField_management i want to divide a field with a spacific number:

arcpy.CalculateField_management(EZG_shp, "IDX_AT_PK", "(!EURO_SUM!/!Anz_Pers!)/1668,4","PYTHON")

This works in ArcGIS Desktop 10.2.1 fine, but the result in arcpy is an error (No NULL-Values a allowed)...

Any suggestions what I am doing wrong?


texts: Why does QGIS not display an attribute table in the order of its defined schema?

texts:
I saw this is a known issue in QGIS v3.2 Bonn. I installed QGIS v3.6 Noosa and still have the same issue.
For example)
csv of .dbf with expected order:

view of attribute table in QGIS:

Any ideas?


texts: Adjusting QGIS 3.6 Print Composer default output resolution?

texts:
When exporting a print layout to image or PDF in QGIS 3.6, the default resolution is 300dpi. I'd like to change that default.

There's an analogue question here: Adjusting QGIS Print Composer output resolution?

But that targets QGIS 2.12 and the answer does not apply to QGIS 3.6.

There is a variable for DPI which is set to 300 but I'm unable to change it: