texts: How to get Geometry points using Geo API

texts:
I have a EPSG:4326 WGS 84 Shapefile and I've converted it into Sql Spatial Data  I'm able to render the map using that with sharpmap 1.1(Previously was using Sharpmap 0.9).
What I'm trying to achieve is when I click on a generated Polygon, the clicked polygon must be filled with a color (For identification purpose) So I'm able to get the point where I click but how to use that point and query for all the point inside that polygon so that I can color all the point which might result in coloring all the polygon.

The problem is I don't know how to do this in sharpmap version 1.1.

Previously when I was using Sharpmap 0.9 I used the below line to get all the points to color whole of the polygon.

  pointArray.Collection.Add(SharpMap.Geometries.LinearRing.GeomFromWKB((byte[])Row["the_geom"]));

My Data is from Sql Spatial DB hence the Row["the_geom"].

So far I've done this.(Which highlights only the point and need to add the points into Geo API collection)

Collection<GeoAPI.Geometries.IGeometry> geomColl = new Collection<GeoAPI.Geometries.IGeometry>();
        GeoAPI.GeometryServiceProvider.Instance = new NetTopologySuite.NtsGeometryServices();
        GeoAPI.Geometries.IGeometryFactory gf = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory();

        SharpMap.Layers.VectorLayer mySuggestedLayer = new SharpMap.Layers.VectorLayer("Higlight");
        fillcolor = shapeFillColor;

        var factory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(_SRID);
        var pointArraySubject = factory.CreateGeometryCollection(null);
        var mySubjectLayer = new SharpMap.Layers.VectorLayer("SubjectIcon");

        DataRow Row = accounts.NewRow();
        for (int i = 0; i < accounts.Rows.Count; i++)
        {
            Row = accounts.Rows[i];
            GeoAPI.Geometries.Coordinate PinPnt = new GeoAPI.Geometries.Coordinate();

            double x = Double.Parse(Row["Xcoord_geo"].ToString());
            double y = Double.Parse(Row["Ycoord_geo"].ToString());

            PinPnt.X = x;
            PinPnt.Y = y;

           //pointArray.Collection.Add(SharpMap.Geometries.LinearRing.GeomFromWKB((byte[])Row["the_geom"]));
            geomColl.Add(gf.CreatePoint(PinPnt));

  mySuggestedLayer.DataSource = new SharpMap.Data.Providers.GeometryFeatureProvider(geomColl);

        mySuggestedLayer.Style.Fill = new System.Drawing.SolidBrush(fillcolor);
        mySuggestedLayer.Style.EnableOutline = true;
        mySuggestedLayer.SRID = _SRID;

        _map.Layers.Add(mySuggestedLayer);

        return _map;

Any idea/help will make my day.


texts:
I'm looking for vehicle travel data in the USA - at any spatial resolution smaller than the unit of a state, and ideally at a city level. I'm interested in daily, or weekly data and also any information about whether the trip is to work or not.

Two sources that I have previously found are the Texas Transportation Institute Urban Mobility Report, and vehicle miles traveled at a 250m gridcell for Massachusetts from the MAPC link (data is available, but site currently has a problem)

I've looked at the Federal Highway Administration FHWA site which has a special GIS section, but I'm struggling to find data on the site outside of reports in the form of pdfs.

Are there any other sources of data that are available that I have overlooked?


texts:
I have set up an instance of OSM on my computer, using this tutorial.

I also installed kosmtik and when I make changes in the styles, kosmtik does take them into account.

Now, I'd like to see my changes reflected in the tiles generated by rendered. So far I'm doing this, with no success:

1°) Stop Apache & renderd:

sudo /etc/init.d/renderd stop
sudo systemctl disable renderd
sudo service apache2 stop

2°) Delete the cache & re-generate my mapnik.xml file:

rm -Rf /var/lib/mod_tile/mymap
carto project.mml > mapnik.xml

3°) Start Apache & renderd

sudo service apache2 start
sudo systemctl enable renderd
sudo /etc/init.d/renderd start

What I am missing?


texts: Rearranging display order of attribute table fields using QGIS?

texts:
Using QGIS 2.10.1, I open an attribute table.  How do I rearrange the field display order?  For example, a table's default display order (from left to right) is State, County, City.  But I would like to see them displayed as City, State, County.

I'm not interested in rearranging the table's internal structure, rather just the table's display.


texts: Geocoding fails in script with Acces violation error

texts:
I'm trying to run geocoding in a python script with arcpy. However, I'm always getting an application error:

I've run the script in PyScripter, ArcMap Python window and Idle, and on several different machines, with the same results. I can manually geocode the data just fine.

Don't know if it makes a difference, but if I run the script a second time without closing the editor. the error is:

Code:

try:
    print("In geocode_facilities...\n")
    address_fields = "Street Street;City Fac_City;Zip Fac_Zip"
    arcpy.GeocodeAddresses_geocoding(childcare_table, geocoder, address_fields, geocoded_fc, "STATIC")

except:
     print("\n\tUnexpected error {0}\n\t{1}".format(sys.exc_info()[0], sys.exc_info()[1]))
     arcpy.AddError(sys.exc_info()[1])
     ok = False

The except clause doesn't get triggered. Straight to access violation error when the script reaches the geocoding line. The first print statement executes, replacing semicolons with commas doesn't change the result. Table to geocode has ~ 750 records. Any clues?

Edit:
I'm using ESRI documentation as a guide. Based on this question, I put the address fields in a list: ["Street Street;City Fac_City;Zip Fac_Zip"]. This eliminates the application error, but gives a RunTime error of Object: Error in executing tool which the except clause does catch.


texts:
I have a GeoJSON point layer from GeoServer. As I recognised there are several ways to style. My question is, is it possible to style it using an SLD from GeoServer?

I use AJAX request for importing the GeoJSON. If not, is it possible to make markers invisible? Not that elegant but I would make layers with styles from GeoServer then have GeoJSON layers with popups.


texts: Adding XY Coordinates from GoogleMaps to ArcMap 10

texts:
I have a list of lat/long coordinates in .xlsx format. I imported this table into ArcMap, but when I plot the points, they are not showing up in the proper place. Instead of showing up in South Africa, the points are showing up somewhere the Gulf of Guinea.

In GoogleMaps, when I get the coordinates for the area where ArcMap is plotting my data, I get somewhere around (-0.418588, 2.013222).

Using Add XY data, I am setting the X to longitude and the Y to latitude. I am using the WGS_1984_Web_Mercator_Auxiliary_Sphere coordinate system.

Sample data:

latitude    longitude
-33.49      18.68
-26.56      25.82
-33.38      20.23
-26.23333   28.13333
-34.31667   19.88333
-26.11667   28.1
-32.36667   27.56667

How can I get these points to show up in South Africa, where they belong, as opposed to in the middle of the Atlantic Ocean?


texts: Setting up layer file template/design for lots of different data in ArcGIS for Desktop?

texts:
So I've started working for a company where people use background data like rivers, buildings, roads and so on a lot. The data is used all over the country, so I have to download a lot of data for each municipalities in my country.

I want to set up a layer file, so that i.e builing data have the same symbology all over, even though it might be 100 different shapefiles for this data. I want all maps to have the same color code and symbology, even if I update the data twice a year, or the shapefiles are from different areas.

What is a good approach for this problem?


texts: ArcGIS Reference Layer over ArcGIS Terrain base(or Imagery) Layer using OpenLayers

texts:
I am using Openlayers for a Map application which uses basemaps by ESRI (or ArcGIS). What I am trying to achieve is something like this:
http://www.arcgis.com/home/webmap/viewer.html
From Basemaps select Terrain with labels.
Here is what I am doing:
arcgis_world_ref_overlay   = new OpenLayers.Layer.ArcGIS93Rest( "World Overlay Reference",
                                   "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/export",
                                    {layers: "1",TRANSPARENT: true},{isBaseLayer: false,opacity: 0.5, displayInLayerSwitcher: false, visibility: false});

arcgis_terrain  = new OpenLayers.Layer.ArcGIS93Rest("World Terrain Base", // name for display in LayerSwitcher
        "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/export", // service endpoint
        {layers: "0", format: 'PNG24', sphericalMercator: true});

Attached is the output I am getting:

This is the desired output (uses Dojo and cached tiles but same service):

What am I doing wrong here?
Any help is greatly appreciated.
Thanks in advance.


texts: GDAL OGR2OGR from gdbtable file to SQL Server table

texts:
There is an existing SSIS package that loads a gdbtable file into SQL server table using ogr2ogr.
Command used is below
--config SHAPE_ENCODING "ISO-8859-1" -append -update -f MSSQLSPATIAL "MSSQL:server=Server1;database=DB1;trusted_connection=yes" "C:\a0000000e.gdbtable" -nln dbo.table2 -gt 100000

With the above command the table2 in DB1 was populated fine before. It populated a ogr_geometry column of type GEOMETRY also fine.
But recently, when the above is run the GEOMETRY column ogr_geometry is populated as NULL.
It also gives an error "ERROR 1: Column O_SHAPE requested for geometry, but it does not exist.".
When I tried creating a dummy table in another DB in same server, say DB2 the geometry column is populated as expected and no error is raised.
Not sure what should I check in the DB1 to see if something has changed recently on the DB1? can someone help?
Thanks in Advance!


texts: C# ogrinfo with virtual vector source doesn't work GDAL 1.10

texts:
I am trying to use GDAL 1.10 with a vector virtual source which is nothing more than the example union of two shapefile layers. from the commandline, ogrinfo works fine on the source. But the C# binding version of ogrinfo cannot open either shapefile.

Is this a known issue?


texts: Generically filtering multiple GeoJSON layers in Leaflet

texts:
I am trying to implement a function that will filter multiple GeoJSON layers in Leaflet based on the contents of a text box on the same page.

For instance, a user may write 4 5 7 10 in the textbox - after pressing a 'submit' button, I now want to update the map to include features that have an ID GeoJSON attribute of 4, 5, 7, or 10.

I need to apply this filter across multiple layers as ID's 4, 5, 7, or 10 could exist across multiple layers. As such the function needs to be generic in that it will look at any layer, check if any of the ID's match and pick them up, regardless of the layer name or the geojson variable used to create the layer.

From what i can tell in the documentation the only way to apply filters is to reconstruct the GeoJSON layer from scratch whilst using 'filter:myfilter'. Is there a way to avoid this? Ideally a way that avoids having to remove layers from the map etc.


texts: How to project DEM to satellite raster extent?

texts:
I want to run a urbanization model. Required data are;

Classified raster data
Slope etc.

I've downloaded DEM data from USGS Earth Explorer. Downloaded data are in DTED format.
I use EPSG:32636 coordinate system in this project. All satellite imagery are in same coordinate system and pixel sizes are fixed 30m x 30m.(Landsat imagery)

Model wants all data projected into same coordinate system. DEM data was in GCS_WGS_1984 format, I have projected DEM data to EPSG:32636 in ArcGIS and setted output pixel size to 30 meters.

Then I've clipped the data so that it can fit study extent.

The Problem is;
After clipping the data I've realized that; number of pixels are not same with the classified satellite imagery. In my slope tif file there are more pixels than the imagery.

I've checked whether satellite image and slope tiff image coincides;

They doesn't coincide  ?

All satellite imagery pixels coincides but I couldn't understand why slope data doesn't coincides with the satellite image pixels.

PS: I've followed and tried the methods described in these web sites;

https://blogs.esri.com/esri/arcgis/2007/06/12/setting-the-z-factor-parameter-correctly/
https://community.esri.com/thread/23190


texts: Setting symbol descriptions of ArcMap layout legends from table?

texts: ArcMap has the ability to show an extended description for each item in the symbol list. How can I populate that property from a table? The goal is to avoid having to edit each symbol one by one in order to add the description.


texts:
I am a beginner in QGIS 2 and Mac OSx Mountain Lion
I need to get line length in meters for different gps waypoints.

1 I import kml file to create a new vector shape (this works fine). The projection CRS is WGS84 (as google earth from which KML files are generated).

I went through many posts but it was impossible to get a correct distance.

Thanks


texts: Available Python client libraries for WFS transactions?

texts:
I am looking for a Python module to allow me to use WFS-T. Everything I found so far only supports getting data out via WFS, I need to INSERT and UPDATE.

owslib does not support WFS transactions (yet?), at least I could not find any signs of it.

fiona will never support WFS: https://github.com/Toblerity/Fiona/issues/104

gdal supports WFS-T via its ogr module but I heard not so great things about this API in Python (Fiona exists after all).

Should I just go ahead with ogr or am I missing something?


texts: Is my Geoserver "Direct WMS Integration" working?

texts:
I have activated the "Enable direct WMS Integration" switch in Geoserver 2.5. As far as I can understand, this enables caching of layers without having to use the "gwc/service/wms" endpoint in the WMS URL.

I assume that this enables geowebcache tilecaching dynamically when the tiles are requested. However, I am not seeing the correponding cache being created in the gwc directory in geoserver_data_dir.

Is it working? How can I tell?


texts: How to find a distance from a point to a polyline in QGIS?

texts: Please show a sample Python code of finding a distance between a point to a polyline in QGIS.  (without any plugin)


texts: Edit GISJOIN attribute ID from census data

texts:
I have two dataframes d1 and d2. My data frames are census data from 2010. I want to merge them using a common attribute (merge (d1, d2, by.x="GEOID", by.y= "GISJOIN").
d1 has the common id as GEOID (for eg. 310019654001) while d2 has the same id attribute as GISJOIN (for eg. 31000109654001). I need to remove the 3rd and 7th 0 from the GISJOIN attribute. Is it possible to do that in R? Also, any other way to make a common attribute?


texts: Will MapInfo only read PostGIS data that has been loaded via EasyLoader?

texts:
NMZ says in this thread that MapInfo will only read data in PostGIS that has been loaded by MapInfo's EasyLoader. I wasn't sure if this was still the case so I've loaded data into postgis via ogr2ogr but indeed MapInfo 12 hits a problem:

ODBC Error: ODBC RC=-1, ODBC SQLState=42601, DBMS RC=7, DBMS Msg=ERROR: zero-length delimited identifier at or near """"; Error while executing the query.

In the postgresql log I can see MapInfo attempting to execute a select statement;

2014-02-16 10:36:36 UTC ERROR:  zero-length delimited identifier at or near """" at character 74
2014-02-16 10:36:36 UTC STATEMENT:  select "ogc_fid", "app_ref", "id", "sdw"."planning"."polygons_ogr_28777"."", public.ST_AsBinary("wkb_geometry") as "wkb_geometry" from "sdw"."planning"."polygons_ogr_28777"

That ."" on the polygons table looks pretty weird to me. Taking a look at the query MapInfo is asking of PostGIS on an easyloader table looks like this;

2014-02-16 10:36:21 UTC LOG:  statement: select "app_ref", "id", "MI_PRINX", "MI_STYLE", public.ST_AsBinary("SP_GEOMETRY") as "SP_GEOMETRY" from "sdw"."planning"."polygons_bng5365"

No ."" in this one.

I'm wondering if MapInfo is particularly to MI_PRINX being the primary key. I've pasted the fuller log file here - loading the two tables via ogr (polygons_ogr_28777) and easyloader (polygons_bng5365) and then accessing the pair via MapInfo.

The numbers in the table names do not reflect any srid btw. Just numbers..

I've built a mapinfo.mapinfo_mapcatalog. There's a trigger function which populates this table when an insert is made to geometry_columns. (PG1.5). The entries for the two tables are;

"spatialtype";"tablename";"ownername";"spatialcolumn"
;"db_x_ll";"db_y_ll";"db_x_ur";"db_y_ur"
;"view_x_ll";"view_y_ll";"view_x_ur";"view_y_ur"
;"coordinatesystem"
;"symbol"
;"xcolumnname";"ycolumnname"
;"renditiontype";"renditioncolumn";"renditiontable";"number_rows"

19.2;"polygons_bng5365";"planning";"SP_GEOMETRY"
;487932.174983;162961.282073;487976.574637;163000.880738
;487932.174983;160574.96515;490597.036446;163000.880738
;"Earth Projection 8, 79, ""m"", -2, 49, 0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641) (8645061.1011, 4470074.53373)"
;""
;"NO_COLUMN";"NO_COLUMN"
;1;"MI_STYLE";"";

19.3;"polygons_ogr_28777";"planning";"wkb_geometry"
;0;0;700000;1300000
;0;0;700000;1300000
;"Earth Projection 8, 79, ""m"", -2, 49, 0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641) (8645061.1011, 4470074.53373)"
;"SYMBOL (35,0,12) PEN (1,2,0) BRUSH (2,16777215,16777215) "
;"NO_COLUMN";"NO_COLUMN"
;1;"";"";

The mapinfo.mapinfo_mapcatalog definition is as follows;

-- DROP TABLE mapinfo.mapinfo_mapcatalog;

CREATE TABLE mapinfo.mapinfo_mapcatalog
(
  spatialtype double precision,
  tablename character varying(32),
  ownername character varying(32),
  spatialcolumn character varying(32),
  db_x_ll double precision,
  db_y_ll double precision,
  db_x_ur double precision,
  db_y_ur double precision,
  view_x_ll double precision,
  view_y_ll double precision,
  view_x_ur double precision,
  view_y_ur double precision,
  coordinatesystem character varying(254),
  symbol character varying(254),
  xcolumnname character varying(32),
  ycolumnname character varying(32),
  renditiontype integer,
  renditioncolumn character varying(32),
  renditiontable character varying(32),
  number_rows integer
)
WITH (
  OIDS=FALSE
);
ALTER TABLE mapinfo.mapinfo_mapcatalog OWNER TO postgres;
GRANT ALL ON TABLE mapinfo.mapinfo_mapcatalog TO postgres;
GRANT ALL ON TABLE mapinfo.mapinfo_mapcatalog TO public;

-- Index: mapinfo.mapcatalog_idx

-- DROP INDEX mapinfo.mapcatalog_idx;

CREATE UNIQUE INDEX mapcatalog_idx
  ON mapinfo.mapinfo_mapcatalog
  USING btree
  (tablename, ownername);

The MapInfo manual also says to create a MapInfo user account which I have done though not sure of its worth.


texts: How can I project earth centered cartesian coordinates (EPSG:4978) to lat lon within Geoserver?

texts: I have a PostGIS database with X, Y, and Z ECEF coordinates and I want to create a layer in Geoserver that displays these coordinates as points in OpenLayers. In Geoserver's create layer page there is a Coordinate Reference System heading with fields Native SRS, Declared SRS, and SRS Handling. I think I want Native SRS to be EPSG:4978, Declared SRS to be EPSG:4326, and SRS Handling to be reproject native to declared but I cannot edit the Native SRS field! Am I trying to do something unsupported?


texts: ogr2ogr coverting DXF to shapefile, why am I losing part of the feature?

texts:
I'm starting to mess around with some of the GDAL toolsets, specifically the ogr2ogr.

I'm working with converting a 2000 ACSII DXF file to shapefiles depending on geometry.

Everything seems to work fine, but I'm not getting the complete feature.

Here's an example of my command:

ogr2ogr -where "OGR_GEOMETRY='LINESTRING' AND LAYER='E-TRANSFORMER'" -f "ESRI Shapefile" transformers.shp System_Map.dxf

Now this does create a polyline shapefile with a good amount of data, but I'm losing a key part I need, here's an example of what I need:

The problem is that the conversion is only giving me the line up to the circle.

Each pie of the circle is its own feature and the line is its own feature. So in this picture there are 4 separate features, but they are all part of the E-TRANSFORMER layer.

Can you think of a reason I am only getting the line leading up to the circle and not the circle too?

FME converts it fine, but I'd rather use GDAL if I could.

Thanks for any help.


texts:
I use terrset idrisi software to create land cover prediction map for the year 2023 in land change modeler. I am trying to do this by implementing logistic regression which is in transition-sub model structure part in transition-potentials tab. I would like to tell you the steps clearly:

Earlier land cover image is Landuse_2007.
Later land cover image is Landuse_2014

Until here, I don't encounter any problem. Change map is created. My transition sub-model is from barrenland to urban. In transition-sub model structure part, I put distance_to_road and distance_to urban variables there and at the logistic regression text results, pseudo r squared is equal to 0.9997.

Prediction map for 2023 is like this:

How can I erase this pink horizontal line from my prediction map?


texts: Rendering single-band raster in Python with set color ramp

texts:
I have a set of single-band gray-scale rasters that I want to save as a rendered GeoTIFF/image that is colored according to a specific color ramp.
For example, if I had some NDVIs that range from a minimum and maximum value of -1 to 1 and I want them colored according to a ramp that would be similar to this: 0 (red) -> 0.5 (yellow) -> 1 (green).
I know how to do this within QGIS and ArcMap but I am looking to do it straight up in open source Python. I have looked into gdal and rasterio but I don't think I've found exactly what I need. Especially when it comes to saving them with the applied color ramp and forcing a min/max value of the ramp.
Are there any resources I can be pointed to?


texts: Writing C# formula to perform simple math on value fields for ArcGIS Reports?

texts:
I'm working in ArcMap 10.1 making a report on Report Designer to compare values in the attribute table with other values.

I would like to ask how to write formulas in C# to do simple math on groups of data found in the value fields?

I have tried to create formula for the Field Types: String, Double, Int32, and Float in Report Designer but cannot create the correct format to perform division between the value fields in the report.


texts:
I'm building a mobile application with PhoneGap for data collection.
I'm able to place map-markers and edit their feature contents. All markers are stored in a L.layerGroup() called markerGroup;

The next step was to create button that saves and stringifies them to GeoJSON. I'm using the easy.button.plugin.

var exportButton = L.easyButton('fa fa-globe', function(){
  //markerDrag.toGeoJSON()
  var data = markerGroup.toGeoJSON();

  // Stringify the GeoJSON
  var convertedData = 'text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(data));
  //console.log(JSON.stringify(Standorte.toGeoJSON(), null, 2));
  console.log(JSON.stringify(data, null, 2));

  // Create download but how?

}).addTo(map);

This works so far. If I would work on a computer, I could copy and paste the console log and create my own GeoJSON, but that's not possible in an application. So I'm looking forward for a way to download or export the collected data to a .js.


texts: Appropriate CRS for Close Distances in USA

texts:
I have a very big dataset in the form of longitude-latitude points in the US; with points from the entirety of contiguous US. I need to calculate the distances between points and check if they are less than 50 meters. For computational reason, I also need to use classic plane geometry; no distance in degree.
I am wondering what CRS I could/should use. I need one CRS for the entire dataset, that is the whole contiguous US. So far, I have used the North America Albers Equal Area Conic (EPSG: 102003), since it appears to be used by the Census. However, when I compare the distances as calculated from this CRS with the distances as calculated from the Haversine formula, the difference is remarkable. At least, for long distances -- I picked random points uniformly in the US, so the distances are in the order of 10^3 km.
Is there a better choice for a CRS?
Will it even make a difference for short distances in the order of 100 m?


texts: Why does cascaded WMS not work? (Geoserver)

texts:
I run a Geoserver installment as a service on a Windows Server 2008 R2 machine.
I try to add a WMS source but everytime I get timeout-exception.
As I need to use a proxy I edited wrapper.conf as follows:

    # Java Additional Parameters
    wrapper.java.additional.1=-Djetty.home=.
    wrapper.java.additional.2=-DGEOSERVER_DATA_DIR="%GEOSERVER_DATA_DIR%"
    wrapper.java.additional.3=-Dhttp.proxySet=true
    wrapper.java.additional.4=-Dhttp.proxyHost=myProxyS
    wrapper.java.additional.5=-Dhttp.proxyPort=8080
    wrapper.java.additional.6=-Dhttp.proxyUser=myUsername
    wrapper.java.additional.7=-Dhttp.proxyPassword=myPW

I restarted the service after my edits but it does still not work.

My System:
Geoserver 2.6.1 (installed as as Service via windows installer)
Java JDK 1.7
Windows Server 2008 R2

Does anyone have any idea why it is still not working?


texts:
I have resources.qrc compiled to resources.py using the following batch file:

@echo off
call "C:\Program Files\QGIS 3.0\bin\o4w_env.bat"
call "C:\Program Files\QGIS 3.0\bin\qt5_env.bat"
call "C:\Program Files\QGIS 3.0\bin\py3_env.bat"

@echo on
pyrcc5 -o resources.py resources.qrc

I import resources at the beginning of the code but i get the following error:

ModuleNotFoundError: No module named 'resources'

I tried editing the .ui file as explained here:
QGIS plugin: Problems importing resources (resources_rc) file - plugin doesn't load - PATH problems?
But I don't have the exact same lines as mentioned instead of:

<resources>
  <include location="resources.qrc"/>
</resources>

I have:

<resources/>
 <connections/>
</ui>

Here is the content of the folder:

Does somebody have a clue what is wrong?


texts: Attempting to bring 2,300 .sid files into one raster

texts: I've tried all of the raster tools within ArcToolbox with no luck having such a large number of files. There are about 7GBs worth of MrSID files totaling about 2,300. Most tools fail or process too slowly when I try to upload all the files. Even more than 10 files seems to slow Arc down too much. I don't know whether it's my procedure or computer that's causing problems. Please provide whatever advice you have. Thank you.


texts: How to export highlighted features from attribute table to an excel file?

texts:
When i selected some portion of the map in QGIS, in the attribute table the selected features gets highlighted...

How to export the highlighted features from attribute table to an excel file automatically..?


texts: Reproject GeoJSON from EPSG:3857 to EPSG:4326

texts:
I am using this reproject tool to convert a GeoJSON point from EPSG:3857 to EPSG:4326.

My command fails. What am I doing wrong?

$ echo '{"type":"Point","coordinates":[-13720479.997764934,5688254.733325758]}' | reproject --from=EPSG:3857 --to=EPSG:4326

/usr/local/lib/node_modules/reproject/cli.js:98
            throw new Error("Could not find definition for CRS \"" + crsName + "\".");
                  ^
Error: Could not find definition for CRS "EPSG:3857".
    at lookupCrs (/usr/local/lib/node_modules/reproject/cli.js:98:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/reproject/cli.js:25:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3


texts: Interpreting Metes and Bound description?

texts:
I am trying to enter a metes and bounds description but it isn't plotting correctly. The description is:

  5.3 acre parcel in the NW4, commencing at the Northest corner, thence South 789 ft to the place of beginning running thence: East 30 feet to
  the East side of the present County Road; thence S. 17 degrees - 05'
  E. 74 ft; thence S. 26-30 degrees E. 500 ft; thence S 1-40 degrees E
  382 ft; thence S. 46 degrees W. 356 ft; thence West 30 feet to the
  west line of the section; thence North 1148 ft to the place of
  beginning.

The call I'm having a problem with is:

  thence South 789 ft to the place of beginning running thence: East 30
  feet to the East side of the present County Road

See the image below. The parcel that I did with the metes/bound is in yellow, slightly below the Borie text. The parcel is supposed to be in the white/green box to its left.  I started my m/b off at "S 17-05 e / 74" and proceeded from there. It is supposed to be 5.3ac, but I am getting 4.7ac afterwards.

When I try putting in W / 30ft and then N and 1148 ft via metes/bounds, there is no movement.

What is it I should be doing or not doing? The ArcGIS 9.3 desktop help is not very helpful. How  does the "thence South 789 ft to the place of beginning running thence: East 30 feet to the East side of the present County Road;" AND "thence West 30 feet to the west line of the section; thence North 1148 ft to the place of beginning" come into play?

I'm using 9.3 ArcView if that helps.


texts:
This is a continuation of a problem that was solved earlier this week. The code below performs a select by location and was originally intended to export all feature classes from the SDE database to shapefiles. However, since the SDE uses coded calues, there is an output issue when using CopyFeatures_management.

The work around that was proposed was to create export to csv/xls, but the TableToExcel function only explicitly accepts tables in arcpy. Someone recommended using arcpy.Describe but how could I take what it reads and convert it to a table? Or is there another solution to this?

import arcpy
from arcpy import env

env.workspace = r'C:\ArcScratch\HM_Production.sde'

stateFeature = r'C:\ArcScratch\State\Parishes_LDOTD_2007.shp'
parish = "Lafayette"
nameField = "PARISH"

arcpy.MakeFeatureLayer_management(stateFeature, 'SelectionStateLayer', '"' +
str(nameField) + '" = ' + "'" + str(parish) + "'")

for fc in arcpy.ListFeatureClasses():

    if arcpy.Exists('lyr'): #cleanup check
        arcpy.Delete_management('lyr')

    arcpy.MakeFeatureLayer_management(fc, 'lyr') #converts feature class to lyr
    arcpy.SelectLayerByLocation_management('lyr', "WITHIN", 'SelectionStateLayer') #selection using parish layer

    outname = fc.replace(".","_") #replaces all . with _
    outpath = r"C:\output\{0}".format(outname)

    if arcpy.Exists(outpath): #cleanup check
        arcpy.Delete_management(output)

    arcpy.TableToExcel_conversion('lyr', outpath) #output selected features

arcpy.Delete_management('lyr')


texts: Transferring large amount of OSM data to PostGIS using osm2pgsql?

texts:
I am new to using OpenStreetMap data and PostGIS database. I learned how to use osm2pgsql and transferred osm data for a small city to PostGIS database and worked fine. The problem is that when I try to do the same for bigger cities or for a whole country it does not work.

So my question is how to use osm2pqsl for transfering large amount of data?

or if there is another option to do this job?

I am interested to read all attributes and tags in OSM that is why downloading shapefile is not a solution for me.


texts:
I'm unable to save any shapefile edits (polygon, point, line) using QGIS. I have tried multiple versions including 3.4 and 3.8. I have tried removing all installed plugins. I have tried new projects, creating new shapefiles, nothing is fixing the issue.
It was working last week without issue but as of this week has not worked.


texts: Aligning raster data to vector data in QGIS?

texts:
I'm in the midst of aligning century-old maps (of Paris) to vector data of the modern same: Qgis' Georeferencer tool works fine, but doing the entire city that way is a gargantuan task. Paris hasn't changed much over the past century, and there is some lens distortion at the edges of the photo of a paper map that is torn in some places, but in all, the raster maps match the present city layout (vector) to ~85%.

I was wondering if anyone has heard of a tool or method that can match 'detected lines' in raster to vector coordinates... I can imagine a first step would be to 'rough align' the maps to vector using Georeferencer, but it's the 'fine tuning' that is most problematic and time-consuming.


texts:
I have a shape that looks like this:

It's the end result of a buffer, merge, bugffer and Chaikin Smoothing process in PostGIS. It's almost perfect however I'd like to remove some of the "fissures". If I could get the shape to have the boundary like the red line below it would be great. Ideally something I can do in postGIS.

Any thought?


texts: Postgis: Point-in-polygon check + feature attributes inheritance

texts:
I have two tables in Postgis 2.1 database:

Polygon features with a reach attributive information;
Regular point grid;

I would like to get a SQL query returning the regular point grid with assigned attributive information from the underlying polygon. The output should contain lat, lon columns and an extra column with a given attribute. This will be passed to R scripts throughout the csv files.

Before:

After:


texts: Translating local coordinate system to world system

texts:
In QGIS we needed to measure an area with a total station but that time without a calibrated world coordinate system (no calibration points available). The North was only roughly oriented by compass.
Finally we now made it to get some of our calibration points measured by GNSS so that we now have them within the world system.
Is there a plugin for QGIS, that I can use to recalculate all other points based on that few ones which we now have in the world system? I guess the elevation is easy to recalculate based on the hight difference but how is it with the X/Y and the North?


texts: Getting First and Last Point coordinates of Polyline with Field Calculator in ArcGIS Desktop?

texts:
I'm trying to get the First Point coordinates (x,y) and Final Point coordinates (x2,y2) from a polyline in ArcGIS 10 with the Field calculator.

I've added 4 (double) fields like StartX,StartY,EndX and EndY,I tried with:

"!Shape!.positionAlongLine(0.0,True).firstPoint.X"
"!Shape!.positionAlongLine(0.0,True).firstPoint.Y"
"!Shape!.positionAlongLine(1.0,True).firstPoint.X"
"!Shape!.positionAlongLine(1.0,True).firstPoint.Y"

But no luck. The error: "The row contains a bad value".

What am I doing wrong?

Thanks to @radouxju for your answer because it was what I was looking for!!, but NOW I don't know What's happening with my ArcGIS10. Let's see:

I could compute all these statements (4), to every field:

"!Shape!.lastPoint.X"
"!Shape!.lastPoint.Y"...

But, after that I checked for errors and I found this! That there are times that the ArcGIS field calculator doesn't compute well. In the example, the yellow one, it's 16 meter long, but its coordinates are the same, but the the next polyline is well computed... What's happening?


texts: MySQL and the ST_IsValid function returns error

texts:
I am running MySQL // Percona 5.7 and I added a Polygon to my table:

DROP TABLE IF EXISTS `test_table`;
CREATE TABLE `test_table` (`uid` int(11) unsigned NOT NULL AUTO_INCREMENT,`geom` geometry NOT NULL, PRIMARY KEY (`uid`), SPATIAL KEY `i_geomidx` (`geom`) );
INSERT INTO `test_table` (`uid`, `geom`) VALUES ('1',ST_GeomFromGeoJSON('{"type": "FeatureCollection","features": [{"type": "Feature","properties": {},"geometry": {"type": "Polygon","coordinates": [[[-91.2,45.4],[-79.8,49.8],[-69.0,43.4],[-88.2,32.6],[-91.2,45.4]]]}}]}',1,4326));
SELECT uid FROM test_table  WHERE ( St_intersects(geom,St_geomfromGeoJSON('{"type": "Point", "coordinates": [-80.8,43.7], "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}',1,4326)));
SELECT St_IsValid(geom) FROM test_table;

The first test with the intersect works like a charm but the ST_IsValid function returns the error:

ERROR 1210 (HY000): Incorrect arguments to st_isvalid

But the MySQL help states:

SET @ls1 = ST_GeomFromText('LINESTRING(0 0)');
SELECT ST_IsValid(@ls1);

Any ideas someone?


texts: Model binary rasters over time against non-spatial variable (e.g., inundation over time vs. gage height)

texts:
I have a time series of raster images for a study area that have been processed to a binary classification (inundated/not inundated). Each image in the series is time-stamped and can be associated with a specific water level in the study area that's expected to predict what cells are inundated.

I want to generate a model that allows me to interpolate/estimate inundation extent at any given water level. Traditional inundation models (e.g., "flooding" a DEM) are not an option because there is relatively little topographic relief in the study area and DEM data do not have sufficient vertical resolution.

Extensive searching for some kind of applicable modelling approach has proved unfruitful. Conceptually, I think of modeling each cell of the raster as a logistic model against gage height. This is clearly not reasonable, as it treats each cell as independent and ignores the certain spatial correlation in the data. It will also be quite unwieldy to fit hundreds of thousands of models... :)

I know I'm missing an obvious answer here. Can anyone send me towards an applicable method?


texts: GRASS raster map types: UInt16 and Float64

texts:
i am in the processing of using r.out.gdal to export DEMs from GRASS into QGIS

this is the **output** of the **first** **try**:
using **UInt16** as the data type.

r.out.gdal input=DEM0maslTopog@UTM_35S format=GTiff type=UInt16 "output=C:/Users/xxx/Documents/xxx/xxx/GIS/Working/UTM35S/DEM G2Q UInt16/0maslDEM G2Q UInt16 R2"

Exporting to GDAL data type: UInt16

 Precision loss: Raster map of type DCELL to be exported as UInt16. This can be avoided by using Float64.

Checking GDAL data type and nodata value

Exporting to GDAL raster

r.out.gdal complete.
Successfully finished

Since the program suggests using Float64, this i try all to end up with error 6, which is not detailed in the GRASS manual (both in-Grass and at http://grass.osgeo.org/grass65/manuals/r.out.gdal.html):
Output from Try 2

r.out.gdal input=DEM0maslTopog@UTM_35S format=GTiff type=Float64 "output=C:/Users/xxx/Documents/xxx/xxx/GIS/Working/UTM35S/DEM G2Q UInt16/0maslDEM G2Q Float64 R2"

Exporting to GDAL data type: Float64

Checking GDAL data type and nodata value

ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.

Exporting to GDAL raster

r.out.gdal complete.
Successfully finished

my query: would the error impact significantly on the export (and results on subsequent DEM usage)

Bearing in mind that i would like to clip the DEMS to a vector area and use two DEMS (produced and exported in exactly the same way) to calculate volume.


texts: Openlayers simplify linestring on the fly

texts:
I have an issue on my OpenLayers openstreetmaps where I am loading LineString features from a kml file. Everything works fine except performance due to the sheer complexity of the LineString and the number of linestrings. I wanted to use the simplyfy() function to simplify the linestring geometry/feature. Here is some code I wrote to simplify on the fly. The problem is in the line of code below:

            feature.geometry.components[i].simplify(0.1);

This does not seem to modify the original geometry feature components at all. What am I doing wrong? I think we might need to use removeComponents and then add the simplified geometries using addComponents() but how to do this?

preFeatureInsert: function(feature)

{
    if (feature != "undefined" && feature.geometry != "undefined" && feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Collection");
    {
        if (feature.geometry.components != "undefined" && typeof(feature.geometry.components) != "undefined")
        {
            for (var i = 0; i < feature.geometry.components.length; i++)
            {
                if (feature.geometry.components[i].CLASS_NAME ==  "OpenLayers.Geometry.LineString")
                {
                    feature.geometry.components[i].simplify(0.1);
                }
            }
        }
    }
}


texts: Identifying topology error with Javascript

texts:
ArcGIS has tool to fix topology errors. Does any JavaScript gis package have similar function?
I have tried two packages.

OpenLayers has the function to build topology from geojson
TopoJson can transfer geojson to topojson

However, both of them simply build topology based on exact matched arc. They don't have ability to identify topology errors like a minor gap between two polygons.


texts:
I have a regular grid of points with wind values with a distance between the points of approx. 300 m. I would like to visualize this and get a TMS (with TileStache) as a regular grid of arrows (direction + strength as size or colour) for every zoom level.

I expect it to look something like this:

Grid of wind arrows

or like this from WXTiles

I tried to get something similar with TileMill but the results are not convincing as you can see on the images:

TileMill and Markers

TileMill and Shields

What would be a way to get a regular grid of arrows in every zoom level? Do I have to prepare a separate file of points for every zoom level with different point intervals? Do you have any suggestions? If possible that would work with TileStache.


texts: QGIS Problem Displaying ArcGIS Map Server Layer

texts:
In QGIS 3.10 I've successfully added an ArcGIS Map Server layer from a county website but I'm not seeing any data? Is there something I'm missing? The Map Server is:  https://lcmaps.lanecounty.org/arcgis/rest/services/Lake/LakeBaseMap/MapServer/

I've loaded the Taxlots layer, but it just shows as totally blank.


texts:
I am having an issue with the Combine function in ArcGIS Pro. The error is this:

ERROR 010328: Syntax error at or near symbol ,.  ERROR 010267: Syntax
error in parsing grid expression.  Failed to execute (Combine).

I have python that has been running well for 6 months with no issues. Now, after a month break I get this error when I run a simple Combine. The code is part of a much longer code.  I tested it in ArcMap (do you call it that anymore?) and I surprisingly get the same error. I tried it with different datasets from a folder on the c drive.  There are no spaces or unusual syntax in the folder or file name.
Python 3.6.9 Unpacking ArcGISPro_26_175036 now.
From the Geoprocessor:
Input rasters   C:\test\focag500;C:\test\focag1000
Output raster   C:\test\test
Code in Python gets the same error after rewrite a short script:
# Import arcpy module
import arcpy
from arcpy import env
from arcpy.sa import *
#import numpy

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

# Overwrites existing data
arcpy.env.overwriteOutput = True

# Setting up the folders
projectFolder = "C:\\GIS_Projects\\ApexTargets"
projectGDB = projectFolder + "\\" + "ApexTargets_Working.gdb"
env.scratchWorkspace = "C:\\test"

maskTemp = projectGDB + "\\bnds_test"
arcpy.env.extent = maskTemp
arcpy.env.mask = maskTemp

outCombine = Combine(['C:\\test\\focag500', 'C:\\test\\focag1000'])


texts: Deriving field parameter from table parameter in Python Toolbox?

texts:
I'm trying to derive a Python Toolbox parameter from another parameter. I'd like to have a tool which determines fields from an input table and applies the list as a filter to a second parameter. This is what I've come up with so far:

class Tool(object):
    def __init__(self):
        self.label = "MFF"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        #input excel spreadsheet table
        lkTab = arcpy.Parameter (
            displayName = "Leak Excel Worksheet",
            name = "intab",
            datatype = "DETable",
            parameterType = "Required",
            direction = "Input")

        #input table field
        lkLkTab = arcpy.Parameter (
            displayName = "Leak Excel Worksheet Leak Field",
            name = "lkLkFld",
            datatype = "Field",
            parameterType = "Required",
            direction = "Input")

        return [lkTab, lkLkTab]

    def updateParameters(self, parameters):
        flds = []
        tab = parameters [0].valueAsText
        if tab:
            flds = [f.name for f in arcpy.ListFields (tab)]
        if not parameters [1].valueAsText in flds:
            parameters [1].value = None
        #trying here to apply filter list of fields
        parameters [1].filter.list = flds

My field list parameter doesn't get populated however when I indicate a table in the first parameter:

How do filter a parameter with a list of fields from another parameter?


texts: Force ST_collect to return only a GeometryCollection

texts:
In the postgis documentation it is mentioned that ST_collect returns a MULTI* or a GEOMETRYCOLLECTION. But how can I force the function to only return a GeometryCollection not depending on it's input argument.

For Example: I have a postgreSQL database with a column of type GeometryCollection. And it should store geometries which a user has drawn. This can by any combination of geometries of points, lines, polygons etc...  If the combination is a point, a line and a polygon ST_collect returns a GeometryCollection. But if the combination is two polygons it returns a MultiPolygon. Is it possible that ST_collect returns only GeometryCollections even if the input is a single polygon?

SELECT ST_AsText(ST_Collect(ST_GeomFromGeoJSON(feat->>'geometry')))
FROM (
  SELECT json_array_elements('{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "properties":{

         },
         "geometry":{
            "type":"Polygon",
            "coordinates":[
               [
                  [
                     14.845962524414062,
                     46.96830518448586
                  ],
                  [
                     14.845962524414062,
                     47.02309964439266
                  ],
                  [
                     14.976425170898438,
                     47.02309964439266
                  ],
                  [
                     14.976425170898438,
                     46.96830518448586
                  ],
                  [
                     14.845962524414062,
                     46.96830518448586
                  ]
               ]
            ]
         }
      }
   ]
}'::json->'features') AS feat
) as f;


texts: Algorithm to remove Loops from a Line-String

texts:
I am using a third-party API to acquire a linestring representing a route. Occasionally, this API (which I will not name, here) returns a linestring that contains loops. Logically, this makes no sense. The shortest path on a plane would never include a loop.

By definition, the presence of a loop in a planar linestring must imply that the linestring intersects itself at some point. Without loss of generality, there must be a segment of the path from the origin of the path to that point of intersection, a segment along the loop that returns to the point of intersection and a segment from that point to the end-point of the path; the way to remove the loop would simply be to remove the segment starting and ending at the point of intersection. I could write an algorithm to do this, it might go something like this...

for each step, U = (a, b), along the line-string
    if the step intersects a previous step, V = (p, q) at z
        insert a step (p, z)
        remove all steps between V and U, inclusive of both
        insert a step (z, b)

My question is simple, are there any published algorithms to remove loops from a line-string (assumed to be planar)?

I don't like to implement my own scribblings without learning, first, what is out there. It's easy to invent an algorithm. It is difficult to invent a perfect one.


texts:
I am a fourth year graduation student of the Amsterdam University of Applied Sciences. I am currently working on my final thesis for which I am doing research on the Amsterdam Airport catchment area.

For a case study on this catchment area, I need to draw isochrones of 10, 25, 50, 75, 100, 125, 150, 175 and 200 kilometers from Amsterdam Schiphol Airport as a starting point of my research. These isochrone boundaries provide me with the information which population lives from a specific distance (access time) from Amsterdam Schiphol Airport and gives me the opportunity to calculate travel time by public transport to Amsterdam Schiphol Airport, but also to other airports. The aim of my study is to show the amount of airport choices for passengers within a distance of 200 KM "catchment area" of Amsterdam Schiphol Airport.

Could someone help me drawing these isochrones?


texts: Error in Implementing levelplot in R for a Categorical Raster with RAT

texts:
I have a raster in .tif format which I am trying to visualize in R using levelplot. Here is what I have done so far:

library(raster)
library(lattice)

data_tif <- raster("fthrt14_21.tif", RAT = TRUE)
data_tif

rat <- read.dbf("fthrt14_21.tif.vat.dbf")
rat
data_tif <- ratify(data_tif)
colnames(rat)[1] <- "ID"
levels(data_tif) <- rat

levelplot(data_tif, col.regions=rev(terrain.colors(5)),main = "Fire Threats"
          , attr(THRT_CLASS))

I am getting an error: Error in UseMethod("levelplot") : no applicable method for 'levelplot' applied to an object of class "c('RasterLayer', 'Raster', 'BasicRaster')"

How can I resolve this error? This is what my RAT looks like:


texts: Add classification value to attribute table?

texts:
I am trying to create a score for values in a table based off where the values fall within a classification range.

Have:

Attribute table with income, range= $29,725 - $76,996

Layer Properties menu that breaks ranges into 3 equal intervals

Want:
Add equal interval label (1, 2, or 3) values back into yet empty income score field (IncScore).

Need to repeat for ~20 fields in the table and this will take a while to field calculate manually...

I am not Python savvy- but could follow a step-by-step solution if someone could explain as if I am a complete novice...


texts: How to select features in a feature collection simultaneously row by row in Google Earth Engine?

texts:
I try to find a correlation between a linear trend of two NDVI time series before and after a specific day in time. And that I want to repeat (iterate/map?) for a lot of points globally distributed. This is the code @Daniel Well helped me with:

var conflicts = ee.FeatureCollection([
  ee.Feature(ee.Geometry.Point([12.492297, 41.89024]), {conflictDate: '2010-01-01'}),
  ee.Feature(ee.Geometry.Point([12.453361, 41.902216]), {conflictDate: '1990-01-01'})
])

var startDate = '1989-01-01'
var endDate = '2013-12-16'

var timeSeries = ee.ImageCollection('NASA/GIMMS/3GV0')
    .filterDate(startDate, endDate)
    .select(['ndvi'])
    .map(function (image) {
      return image.addBands(
        ee.Image(image.getNumber('system:time_start'))
          .subtract(ee.Date(startDate).millis())
          .divide(1000*3600*24) // days
          .int()
          .rename('t')
      )
    })

var conflictsWithSlopes = conflicts.map(addSlopes)
print(conflictsWithSlopes)
print('slope change stats', conflictsWithSlopes.aggregate_stats('slopeChange'))
// Other aggregate_*() functions...

function addSlopes(conflict) {
  var conflictDate = conflict.getString('conflictDate')
  var beforeSlope = getSlope(timeSeries, conflict, startDate, conflictDate)
  var afterSlope = getSlope(timeSeries, conflict, conflictDate, endDate)
  return conflict
    .set('beforeSlope', beforeSlope)
    .set('afterSlope', afterSlope)
    .set('slopeChange', afterSlope.subtract(beforeSlope))
}

function getSlope(timeSeries, conflict, startDate, endDate) {
  return timeSeries
    .select(['t', 'ndvi'])
    .filterDate(startDate, endDate)
    .reduce(ee.Reducer.linearFit())
    .select('scale')
    .reduceRegion({
      // If your conflict regions aren't points,
      // you might want to use a mean or median reducer
      reducer: ee.Reducer.first(),
      geometry: conflict.geometry(),
      scale: 8000
    })
    .getNumber('scale')
}

Now I would like to use conflict points (around 9000) and their corresponding dates (like in the example) stored in a FC Link
The conflict coordinates column is called "coordinate" and the date "date_start".

So far I have tried this:

var conflicts = conflicttable.select(['coordinate']);
var conflictDate = conflicttable.select(['date_start']);

and I get this error:
FeatureCollection (Error)
Error in map(ID=000000000000000005a2): DateRange: Parameter 'start' is required.


texts: What is this blue v that pops up when I open QGIS?

texts: Everytime I open QGIS a blue v pops up. I have tried downloading version 3.12 and 3.14 and both of them have the blue v. I even tried uninstalling and redownloading version 3.14 to see if it would go away. I can pick it up and move it around. It doesn't seem to get in the way when I work, but I'm just curious what it means.


texts: arcpy.da.UpdateCursor error: RuntimeError: create cursor has failed

texts:
I'm trying to delete a few rows in the output table that is created using the Compare Table tool (anything that has an ObjectID < 0). My script was working fine (i.e. it produced the table compare output), until I inserted this Update Cursor code. It's throwing me a RuntimeError: create cursor has failed error. I tested a Search cursor in its place, and that worked fine. I'm thinking there may be a lock of some sort on the data since it was just created, but I'm not sure how to clear that lock. Any ideas?

arcpy.TableCompare_management(orig_queryTable, arcgisTable_cleaned, "UNIQUE_ID", "ATTRIBUTES_ONLY", "IGNORE_SUBTYPES", "", "", "CONTINUE_COMPARE", out_compare_file=compareTxtFile)

sqlExp = """ "ObjectID" < 0 """
with arcpy.da.UpdateCursor(compareTxtFile, "ObjectID", sqlExp) as deleteCursor:
    for row in deleteCursor:
        deleteCursor.deleteRow()


texts: Error 999998 when saving raster dataset after using any raster algebra functions in ArcPy?

texts:
I'm getting the following error without any documentation whenever I attempt to save a raster dataset after having used any algebraic functions (with any other raster or constant):

  Traceback (most recent call last):

    File "C:\Python27\ArcGIS10.6\Lib\site-packages\pythonwin\pywin\framework\interact.py", line 575, in OnEditExecClipboard
        exec o in main.dict
      File "", line 95, in
    RuntimeError: ERROR 999998: Unexpected Error.

I've tried to minimize memory utilization by going as far as breaking it down into as many small pieces as I can and deleting the variables after using them. I've also tried using Plus(,) instead of +, Times(,) instead of *, taking things outside of loops and doing them individually, and nothing. I can save the output of any other function as long as there was never any algebra involved in the leadup Any suggestions? Here's one version of my code:

import arcpy as arc
arc.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:\Users\hp\Documents\Work\EE_Model"
arc.env.outputCoordinateSystem = arcpy.SpatialReference("WGS 1984 UTM Zone 014N")
arcpy.env.cellSize = "MINOF"

# Set up Soil Raster
...

# Create Soil sub-Rasters

arc.conversion.PolygonToRaster("Soil_Cut.shp","N_G1","N_G1.tif",cellsize = 200.0)
arc.conversion.PolygonToRaster("Soil_Cut.shp","N_G2","N_G2.tif",cellsize = 200.0)
arc.conversion.PolygonToRaster("Soil_Cut.shp","N_G3","N_G3.tif",cellsize = 200.0)

print "Soils Converted"

N_G1 = arc.sa.Int("N_G1.tif")
arc.sa.EucAllocation(N_G1).save("N_G1.tif")
N_G1 = "N_G1.tif"

N_G2 = arc.sa.Int("N_G2.tif")
arc.sa.EucAllocation(N_G2).save("N_G2.tif")
N_G2 = "N_G2.tif"

N_G3 = arc.sa.Int("N_G3.tif")
arc.sa.EucAllocation(N_G3).save("N_G3.tif")
N_G3 = "N_G3.tif"

print "Soils Interpolated"

arc.sa.Times(N_G1,0.05).save("N_G1.tif")

EDIT: I should also note that trying to call a method like .minimum or .maximum results in this error:

  Traceback (most recent call last):

    File "C:\Python27\ArcGIS10.6\Lib\site-packages\pythonwin\pywin\framework\interact.py", line 575, in OnEditExecClipboard
        exec o in main.dict
      File "", line 22, in
    RuntimeError: ERROR 999998: Unexpected Error.


texts: Selectively removing whitespace from a string with SQL

texts:
I have two columns of adresses that I need to join. Column 1 has the adresses formatted as "Some Street 12 A" while column 2 has them formatted as "Some Street 12A."

Ie. the last whitespace between 12 and A is removed in one of the columns. Is it possible to write an SQL condition that recognises the white space following a number when doing a database join?

I can't count white spaces since some street names have white space in them and some don't.

If you have a software specific solution, I have access to QGIS and ArcGIS Desktop (most basic license, whatever it's named at the moment.) If you have a solution in either of these software packages even if it doesn't use SQL, that's fine as well.


texts: Adding both string and automated numbers in series to attribute table using ArcGIS field calculator?

texts:
I would like to fill a column in my attribute table with an string that ends in a numeric value.

Example:

Object001
Object002
Object003

I would like to automate the process of filling in the attribute table.

There is a great post on Adding automated values to attribute field? made previously that explains how to add numbers in series to an attribute table. I would like to build on this code by adding a string invfront of the number.

I'm trying to combine the python code found in the above post with a string but it isn't working. See below for the code which will add a series.

    Expression:
autoIncrement()

Expression Type:
PYTHON_9.3

Code Block:
rec=0
def autoIncrement():
 global rec
 pStart = 1 #adjust start value, if req'd
 pInterval = 1 #adjust interval value, if req'd
 if (rec == 0):
  rec = pStart
 else:
  rec = rec + pInterval
 return rec

However when I try and combine the code in the field like below, I just get an error.

'Object'autoIncrement()

**or**

'Object' & autoIncrement()

My syntax is wrong but I'm not quite sure how to correct it.


texts:
Theme switcher from git version seems broken too. I believe that I got the right configuration with GISProjectListing.js as projects are correctly displayed but map switching fails on "Loading Map". Note that I could not even get it to work with the test data provided...

Is there proper documentation on configuration? There is absolutely nothing in logs. Alternatively is there a stable version of the software as what is in git seems really untested.

Platform is Ubuntu 14.04.

Update:

Looking at working sites, I saw that the projectpath variable was set to "". This setting works in my case but still I have to manually adjust the map as bounding box is not taken from project neither from startExtent variable. Any idea what could be wrong with the map bounding box? GlobalOptions.js has project with EPSG 3857 to allow definition of bounding box bringing user to the right area from QWC main page but all map layers use EPSG 4326. In GISProject.js all "visibleLayers" are with EPSG 4326. Could it be the reason for the problem, should one visible layer use EPSG 3857?


texts: Why is SAGA from the Processing Plugin not recognised?

texts:
Similar to SAGA algorithms don't work in QGIS 2.8 except that SAGA does not appear at all in the Processing Toolbox:

As a check, I used the Python Console with the following code to see if any SAGA tools are available (which they're not):

import processing
processing.alglist()

I've installed QGIS 2.8.2 Wien via the OSGeo4W Network Installer, 64-bit and downloaded the latest version of the Processing Plugin (v2.9.3).


texts: File overwrite error 22 in qgis graphical modeler while running modeler more than once

texts: File overwrite error 22 'invalid file' in qgis graphical modeler while running modeler more than once, when system is restarted in there is no temporary file in qgis workspace then model runs fine and produces output, but when run again gives error 22


texts: i want to add a geocode service for roads in Ivory coast ,,, i just have the names of places (no ZIP code) ! it works on arcmap but on it doasn't work on the server !


texts: Lines between corresponding points from two shapefiles

texts:
I want to make a QGIS map of a project where schools and firms are partners for education. I have a .shp of the schools and a .shp of the firms. Both have an ID column (like school number 4 is partner of firm number 4 etc.).

Is there an easy way to draw lines between the corresponding points from the two layers? MMQGIS and HubLines does not get the results right.


texts: Publish WMS service from my own image rendering library

texts:
I have written a Python package whose main function takes a bounding box as input, reads the according data from a data source of mine and renders it into a png image which is returned to the caller. On top of this library, one could easily add an http API or a command line interface for external usage without Python.

Now, I would like to publish my images as a WMS service so that I can view my layer using any standard WMS client like QGIS. Of course it would be possible to implement a fully compliant WMS API on top of my library, however, the specification is kind of extensive and allows for a lot of mistakes to make.

Is there any tool or library available that would do the heavy lifting of the WMS API but still can serve my own images which would be created by calling out to my Python library (using pure Python, a command line interface, an HTTP API or whatever works)?

I am aware of the following solutions and do not consider them to be suitable:

Use GeoServer (or MapServer or uDig or ...) to do the rendering and publish the data as WMS. The way that my images are created is out of the scope of what GeoServer's styling features are capable of. Maybe I could write my own plugin for it but this sounds kind of heavy.
Pre-render all possible images, put them into some folder and let that folder be served by GeoServer or similar tools. However, my data is too dynamic to be proxied for a long time and would outdate pretty quick.


texts: Symbolizing point feature with arrow to show azimuth in ArcMap?

texts: I am creating plot locations with a point feature class and I want to have an arrow coming off of the point to show direction from the plot. I have a field with azimuth values to use but I can't seem to find anything in the symbology properties that I could use to achieve this.


texts:
I'd like to turn all (valid) values in a virtual raster to 1s and all null values to 0. I've run a script from OSGeo4W which divides height values by themselves and the results are fine, but can take a while with some larger .vrt 's.

I'm looking for a more elegant (computationally simple) solution to this problem. The null values to 0 is optional, they can stay as null values.


texts: How to write Con expression in Raster Calculator

texts:
I want to calculate S factor for USLE model when I tried to run my expression, I met a problem.

Con("Slope_Fill_sl" <=5 ,10.8*Sin("Slope_Fill_sl" +0.03 )

Can anyone tell me which part I did wrong？


texts: How to make buttons work from second window in my QGIS plugin?

texts:
I'm trying to develop a QGIS plugin. I already created a second window. In that second window, there are several buttons that I need them to work. I can't say I'm a programmer that's why I don't really know what should I add to my main plugin code?
This is the part of the code I included in my main plugin code to show a second window:
def secondscr(self):
    #code the 2nd screen here
    self.Form = QtGui.QWidget()
    self.ui = Ui_Form()
    self.ui.setupUi(self.Form)
    self.Form.show()
    self.Form.comboBox

And then in the run def: I added this line of code
self.dlg.pb_1.clicked.connect(self.secondscr)

Now, I have a comboBox in my second window.
I used this code in my run def:
layers = QgsProject.instance().layerTreeRoot().children()
self.dlg.comboBox.clear()
self.dlg.comboBox.addItems([layer.name() for layer in layers])

The problem is that my main plugin code doesn't know what is comboBox (since it only exists in my second window not in my main window).


texts: Difference between Affine, Bilinear and Helmert Transformations

texts:
I'm georeferencing old arial photos with a commercial GIS. The software offers me 'Affine', 'Bilinear' and 'Helmert transformation' as transformation options. Unfortunately, the support of the GIS can't really tell me what the differences are and which option to choose in what situation.
All three give me slightly different results. Perhabs someone with knowledge in Transformation can explain me that option X is good in heterogeneous surfaces while Y is good for a cetain typ of arial photos or something like that?
When to choose which option?


texts:
I have some rasters (.tif) and need to identify sinks and calculate TINs for sink volume calculations in R. I have done this before using ArcGIS but for various reasons I want to use R now. I'm not so familiar with R packages, so maybe someone has a good idea on how to get it done.

So far, I've found the lidR package which only uses .las-data and I'm not sure if it is possible to transform .tif-files to .las format.

Also, I've found the RSAGA package, but unfortunately this needs the path to an existing SAGA-installation which doesn't exist (I am working on a Linux server without a SAGA installation).

TINs are mentioned on the sf website (https://r-spatial.github.io/sf/articles/sf1.html), but there is no explanation on how to create them with sf-functions.

Are there other possibilities to calculate sink volume in rasters?


texts: Nearest neighbour / spatial join with attribute condition

texts:
I have 2 point format datasets I wish to schematically join (manholes & gullies).  I am content that I can join them by nearest proximity alone using e.g. NNJoin plugin.

What I would like to do is add a further condition whereby the join is established by working out the nearest node conditional on that node having an elevation attribute equal to or less than the elevation attribute of the gully record, i.e. if nearest manhole is higher than the gully, then go to next nearest, etc, until a solution is found.

Is this possible using the build in tools in QGIS?


texts: How can I add grid lines to a print composition using pyqgis?

texts:
I'm writing a qgis plugin to create an image in the print composer of the current map.  I can get the map rendered in the proper place with a frame of the right width, and I can get grid annotations rendered in the proper places and orientation, but I can't get the actual grid lines to render.  Here is the code I'm using:

def createImage(self):
    # Initialize the composition object.
    mapRenderer = self.iface.mapCanvas().mapRenderer()
    composition = QgsComposition(mapRenderer)
    composition.setPlotStyle(QgsComposition.Print)
    composition.setPaperSize(483, 330)
    composition.setPrintResolution(300)

    # Initialize the map object.  Allow a top margin of 10mm, a bottom
    # margin of 50mm, a left margin of 10mm, and a right margin of 10mm.
    mapOriginXMm = 10
    mapOriginYMm = 10
    mapWidthMm = 483 - 10 -10
    mapHeightMm = 330 - 10 - 50
    composerMap = QgsComposerMap(composition, \
                                     mapOriginXMm, \
                                     mapOriginYMm, \
                                     mapWidthMm, \
                                     mapHeightMm)
    composition.addItem(composerMap)

    # Create the frame around the map.
    composerMap.setFrameEnabled(1)
    pen = QPen()
    pen.setWidth(0.2)
    pen.setJoinStyle(Qt.MiterJoin)
    composerMap.setPen(pen)

    # Initialize the image object.
    dpi = 300
    dpmm = dpi / 25.4
    paperWidthPixels = int(dpmm * composition.paperWidth())
    paperHeightPixels = int(dpmm * composition.paperHeight())
    image = QImage(QSize(paperWidthPixels, paperHeightPixels), \
                       QImage.Format_ARGB32)
    image.setDotsPerMeterX(dpmm * 1000)
    image.setDotsPerMeterY(dpmm * 1000)
    image.fill(0)

    # Create the map grid.
    composerMap.setGridEnabled(True)
    composerMap.setGridIntervalX(500)
    composerMap.setGridIntervalY(500)
    composerMap.setShowGridAnnotation(True)
    composerMap.setGridAnnotationPrecision(0)
    composerMap.setGridStyle(QgsComposerMap.Solid)

    # Top
    composerMap.setGridAnnotationPosition(QgsComposerMap.OutsideMapFrame, \
                                              QgsComposerMap.Top)
    composerMap.setGridAnnotationDirection(QgsComposerMap.Horizontal, \
                                               QgsComposerMap.Top)
    # Bottom
    composerMap.setGridAnnotationPosition(QgsComposerMap.OutsideMapFrame, \
                                              QgsComposerMap.Bottom)
    composerMap.setGridAnnotationDirection(QgsComposerMap.Horizontal, \
                                               QgsComposerMap.Bottom)

    # Left
    composerMap.setGridAnnotationPosition(QgsComposerMap.OutsideMapFrame, \
                                              QgsComposerMap.Left)
    composerMap.setGridAnnotationDirection(QgsComposerMap.Vertical, \
                                               QgsComposerMap.Left)

    # Right
    composerMap.setGridAnnotationPosition(QgsComposerMap.OutsideMapFrame, \
                                              QgsComposerMap.Right)
    composerMap.setGridAnnotationDirection(QgsComposerMap.Vertical, \
                                               QgsComposerMap.Right)

    composerMap.setAnnotationFrameDistance(1)
    composerMap.setGridPenWidth(5.0)
    composerMap.setGridPenColor(QColor(0, 0, 0))
    composerMap.setAnnotationFontColor(QColor(0, 0, 0))
    composerMap.setGridBlendMode(QPainter.CompositionMode_DestinationOver)

    # Do the rendering.
    imagePainter = QPainter(image)
    paperRectMm = QRectF(0, \
                             0, \
                             composition.paperWidth(), \
                             composition.paperHeight())
    paperRectPixels = QRectF(0, 0, paperWidthPixels, paperHeightPixels)
    composition.render(imagePainter, paperRectPixels, paperRectMm)
    imagePainter.end()

    image.save("/opt/tmpPhotos/test.tif", "tif")

Can anyone tell me what I'm missing?


texts:
I am preparing some visualizations of data (mainly animated choropleths), and I am looking for suitable tools.
Ideally, I am looking for something similar to this kind of animated infographics. So, I don't need very advanced GIS analysis, but rather graphical capabilities that allow me to add animated arrows/text/symbols/etc.
So far I checked:

ArcMap: obviously it's very powerful, but the animations seem rather disappointingly crude.
QGIS: same as ArcMap. Powerful tool but the results are not very sleek either.
OpenLayers/LeafLet/d3: they are fine to render an interactive choropleth, but not to generate a complex animation.

Any suggestions?


texts:
I try to convert a feature table Geodatabase to MapInfo with FME / Python
But each test, my application crash.
There is no geometry in my feature table in file geodatabase.
Why my application crashes with attribute table ?

    writerTab=FMEWriter("MITAB")
writerTab.open(RepMapInfo)

schemaTab=FMEFeature()
while reader.readSchema(schemaTab):
    #print writerTab.getSchemaFeatures()
    log.logFeature(schemaTab)
    writerTab.addSchema(schemaTab)

while reader.read(schemaTab):
    log.logFeature(schemaTab)
    writerTab.write(schemaTab)

The code is very simple.
Help me :)


texts: Arcpy - Calculate volume using CutFill tool

texts:
Currently i have the output of Pix4D which contains: DSM, DTM, LAS file. I want to calculate the volume of a polygon specified by coordinate.
Here is the script i'm using right now:

        arcpy.FeatureToRaster_conversion(Polygon_Layer, "FID", poly_mask, Cellsize)

        #Convert Poly verticies to points, extract raster value to poly points, convert poly to raster
        poly_boundaries = "p_boundaries.shp"
        arcpy.FeatureVerticesToPoints_management(Polygon_Layer, poly_boundaries, "ALL")
        #arcpy.AddMessage("Extracting elevation values from elevation raster...")
        poly_boundaries_elevation = "p_boundaries_elevation.shp"
        ExtractValuesToPoints(poly_boundaries, Elevation_Raster, poly_boundaries_elevation, "NONE", "VALUE_ONLY")

        #converts raster with elevation points to a TIN.
        tin_parameter = poly_boundaries_elevation + " RASTERVALU masspoints"
        poly_tin = "poly_tin"
        arcpy.CreateTin_3d(poly_tin, sr, tin_parameter, "DELAUNAY")

        #Tin to raster
        TinRastCellSize = "CELLSIZE " + Cellsize
        cap_raster = "cap_raster"
        arcpy.TinRaster_3d(poly_tin, cap_raster, "FLOAT", "", TinRastCellSize, "")

        #calculates volume above raster, adds output to the poly shp
        outCutFill = CutFill(clipped_raster, cap_raster, 1)
        temporary_cut_fill = "cutfill.tif"
        outCutFill.save(temporary_cut_fill)

The raster i used in this script is DSM.
I use DroneDeploy.com to recheck my result, but the problem is that:

If my polygon contains small feature such as: hole, building then my result is quite similar to DroneDeploy
But if my polygon is big and contains buiding, tree, hole etc then just Fill volume is correct and Cut volume is not similar to DroneDeploy result.

I have tried to changed to using DTM but the result is not correct. Can you guys show me what's wrong with my script?


texts:
I have an image collection(image) with 'system:time_start'.

My function(iterate) is to get [img1, img1+img2, img1+img2+img3, img1+img2+img3+img4, img1+img2+img3+img4+img5].

But after I calculated, I found that the collection (b) did not contain system:time_start.

The result I expect is，For example,

img1+img2 'system:time_start' is img2,
img1+img2+img3 'system:time_start' is img3.

Here is the code link: https://code.earthengine.google.com/21be41cc79b8b855dbd4fd1cdf03f8c8


texts: postgis and osm2pgsql: authentication failed

texts:
Id like to import osm into my postgis to use it with qgis. I followed exactly these instructions: http://wiki.openstreetmap.org/wiki/PostGIS/Installation

At step #Activate_PostGIS:

psql --username=gisuser --dbname=gis --command="\d"

This error occured:

psql: FATAL:  Peer authentication failed for user "gisuser"

(Same after importing my *.osm by doing this:

osm2pgsql -s -U gisuser -d gis path-to-file.osm

Error:

Error: Connection to database failed: FATAL:  Peer authentication failed for user "gisuser"

I have no idea what to do, so im asking here.

Using xubuntu 12.10, postgres 9.1.11


texts: How to set the length of a line using openlayers

texts:
I'm trying edit a polygon by changing the length of some lines by code. Found this method to calculate based on the bearing.

But I didn't find anything on how to calculate the bearing, before I start research my math notes and code this bearing calculation, any recomendations ?

thanks


texts: How to combine multiple mysql tables data resultset for geoserver?

texts:
I need to extract data from multiple tables, choose whether to remove duplication or add up according to the business rules.

I have read some related GeoTools documents, such as ContentDataStore. But all I need is to assemble my own result set. Is there a simpler way that I can implement certain methods of class? It's just the data assembly or can you give me more tutorials or some custom examples?


texts: Changing vertical and horizontal position for specific label in QGIS?

texts:
I want to to change vertical and/or horizontal position of a specific label by editing the label properties. For that I put the desired layer into edit modus and clicked on the "change label" button, and marked a specific label. Seems to be straight forward, but it does not as I expect it. Whatever I try in the list box for horizontal positions ("center, left, right") has no effect after clicking the OK button or the "take over" button. It is the same with other settings, except the degree and the text, which I can change.

The translations might be wrong, but I am working on a German computer.

Did I miss something, or is that a bug?

I use QGIS 3.8 on Manjaro.


texts: ArcGIS Administrator's "Availability" tab crashes the application

texts:
I'm seeing a strange problem in the ArcGIS Administrator for Desktop. The Availability tab is crashing the application, with an endless loop listing 3D Analyst (which doesn't appear to be fully enabled). Both 3D Analyst and Spatial Analyst should be licensed.

ArcGIS Desktop functions normally, so the floating LM is working - but 3D and Spatial Analyst are listed as "not available". The application freezes and I need to force-close it.

I'm running Windows 7 on a Mac, using Parallels (not sure if that makes a difference). Interestingly this exact problem occurs on 2 Macs using the same setup.

Before I uninstall the LM, is there anything I should test or check?


texts: How can I reproduce Getis-Ord GI* hot-spot analysis tool in QGIS?

texts: I'm trying to find a hot-spot analysis plug-in for QGIS that would perform similarly to the Getis-Ord (Gi*) hot-spot analysis tool used in Arc, but have not been successful. Does anyone have a suggestion for where to find one?


texts: Is it necessary to use a third party service for serving this case?

texts:
I have been assigned a task to  help build a mobile app, which only shows terrain view of map with a fixed (min/max) zoom level based on mobile phone position and moveable markers which are provided by our server in json format (vector with speed, directions, etc) .

Now.. since i haven't a big experience dealing with GIS data,
how could i serve the tiled images to client without having to query a 3rd party service? I only need the static images plus a custom json to client, should i build a server or use a 3rd party service(gmap,etc).

Given the amount of expected load and the restrictions set by 3rd party services on limitation of storing or even caching data on local machines is what i try to avoid. Contribution to the 3rd party such as a Google map is something i personally dislike, OpenStreet map though is better from my point of view.

Example

I have the London Territory which it isn't required to maximize Zoom, need to serve its Terrain point of view, based on OSM data for highways/rivers etc, a special json is generated from server-side which both tiles+custom json are supposed to be delivered to client, in order to sync and present a response to clients action.

Since it rather unlikely for the terrain view (tile) to change for like the next year, and i can't cache from 3rd parties, how can i serve this?

  Conclusion just for the record

Well after a review and research we decided to go with Leaflet at client side since it looks mature, build our tilesets with TileMill and serve PNGs.

The application will use own tiles for rendering terrain view of major cities, with availability for zoom (at fixed levels) , if any user wants to view other cities the application will try to connect to server and start caching tiles that it receives, but in favor of NOT consuming all of phone memory or ram, it will limit its caching on <100MB (guess that is enough).


texts: How to make labels be center justified in an OpenLayers Web Map?

texts:
I am trying to set the justification for some labels to be centered on the point.  I am using Qgis2web to create a web map.  Below is the relevant output code:
    var size = 0;
    var placement = 'point';

    var style_Equipment_0 = function(feature, resolution){
        var context = {
            feature: feature,
            variables: {}
        };
        var value = ""
        var labelText = "";
        size = 0;
        var labelFont = "26.0px \'MS Shell Dlg 2\', sans-serif";
        var labelFill = "#050000";
        var bufferColor = "";
        var bufferWidth = 0;
        var textAlign = "left";
        var offsetX = 8;
        var offsetY = 33;
        var placement = 'point';
        if (feature.get("LABEL") !== null) {
            labelText = String(feature.get("LABEL"));
        }
        var style = [ new ol.style.Style({
            image: new ol.style.RegularShape({radius: 8.0 + size, points: 6,
                stroke: new ol.style.Stroke({color: 'rgba(35,35,35,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(164,17,244,1.0)'})}),
            text: createTextStyle(feature, resolution, labelText, labelFont,
                                  labelFill, "center", bufferColor,
                                  bufferWidth)
        })];

        return style;
    };

var createTextStyle = function(feature, resolution, labelText, labelFont,
                               labelFill, placement, bufferColor,
                               bufferWidth) {

    if (feature.hide || !labelText) {
        return;
    }

    if (bufferWidth == 0) {
        var bufferStyle = null;
    } else {
        var bufferStyle = new ol.style.Stroke({
            color: bufferColor,
            width: bufferWidth
        })
    }

    var textStyle = new ol.style.Text({
        font: labelFont,
        text: labelText,
        textBaseline: "middle",
        textAlign: "left",
        offsetX: 8,
        offsetY: 3,
        placement: placement,
        maxAngle: 0,
        fill: new ol.style.Fill({
          color: labelFill
        }),
        stroke: bufferStyle
    });

    return textStyle;
};

I tried modifying the placement variable and textAlign variable but nothing changes the justification of the labels.


texts: I have line strings in points and need to conver them to lon/lat degrees

texts:
I need to convert line strings back to latitude & longitude coordinates.

Here are is an example, please keep in mind that they do NOT reference the same point. I have included the values to illustrate the differences between the way points are stored in PostGIS and what I need, which is the values in degrees.

Example:
The data used to expresses a point in QGIS looks something like...
663821.19 1185061.15

I want to convert it to degrees so it looks some thing like this...
10.679080000 -61.507780000

Any thoughts on this would be greatly appreciated.


texts: Inserting values from one table into another using ArcPy?

texts:
I am trying to write a script that iterates through each row of a table, calculates for this row something. The result of this calculation is finally stored in another table (with just one row). Now I want to add this value to the starting table in the same row. And that is where I am stuck. I tried to work with SearchCursor and UpdateCursor but I am not sure how to make it work between these two tables. (Join is not possible, as there is no field the join could be based on)

Sorry, here is the script. The problem is really at the end.

import arcpy
from arcpy import env
from arcpy.sa import *

# Set the workspace
env.workspace = "D:/next/"
env.scratchWorkspace = "D:/next/"

# Set object property to overwrite existing output
arcpy.gp.overwriteOutput = True
# Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial")

# Set Raster Variable
inRaster = arcpy.GetParameterAsText(0)
FieldName = arcpy.GetParameterAsText(1)
inputFeature = arcpy.GetParameterAsText(2)

#Add a field to the inputFeature, for results
arcpy.AddField_management(inputFeature, FieldName, "LONG")

#Create the search cursor
rows = arcpy.SearchCursor(inputFeature)

for row in rows:

    # Create a Where Clause to select only the current record
    whereClause = '"FID" = ' + str(row.FID)
    IDField = str(row.FID)
    tempData = "row" + IDField + ".shp"
    # Create a feature layer from the current row only
    arcpy.MakeFeatureLayer_management(inputFeature, tempData, whereClause)

    # Extract the cells of a raster that underly the selected feature
    maskedRaster = ExtractByMask(inRaster, tempData)
    maskedRaster.save ("D:/next/" + "row" + str(IDField))

    # Create the table for the new "maskedRaster" (for each value a row and the count of the values)
    newRaster = "row" + str(IDField)
    arcpy.BuildRasterAttributeTable_management(newRaster, "NONE")

    # here would be all the calculations
    # I leave them out the skript is long enough, already

    # Summarize the values. A dbf-table with only one row is the result
    stat = [["Calc", "SUM"]]
    arcpy.Statistics_analysis(newRaster, str(newRaster)+".dbf", stat )

    # Now create an update Cursor to add the value to the selected row
    rows2 = arcpy.UpdateCursor(inputFeature)

    # Here comes the problem
    for row2 in rows2:
        if row2.FID == IDField:
            row2.setValue(FieldName, row2.getValue(arcpy.CalculateField_management(str(newRaster)+".dbf", "SUM_Calc"))
            rows2.updateRow(row2)

    del row2, rows2
del row, rows


texts: What is the wildcard character that represents "one or more characters" in QGIS queries

texts:
I'm applying a style to a layer in QGIS using rule-based styling (queries).

I know % is the wildcard character that can be used to represent 'zero or more characters' in these queries.  Is there a character I can use to represent 'at least one character'?


texts:
I am fairly new to pyQGIS plugin development.
In my "goodNeighbor_dialog_base.ui" file I have two comboBoxes 1 and 2.
When my plugin loads, I am successfully able to load all layers in comboBox1 by calling a custom function. I have another function getcolumns(self) that should populate comboBox2 with attributes of the layer selected in comboBox1, when the user selects a layer in it. To do that I am using the "currentIndexChanged" event as shown in the last line of the code segment

 def __init__(self, iface):
        """Constructor.

        :param iface: An interface instance that will be passed to this class
            which provides the hook by which you can manipulate the QGIS
            application at run time.
        :type iface: QgsInterface
        """
        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value('locale/userLocale')[0:2]
        locale_path = os.path.join(
            self.plugin_dir,
            'i18n',
            'goodNeighbor_{}.qm'.format(locale))

        if os.path.exists(locale_path):
            self.translator = QTranslator()
            self.translator.load(locale_path)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)

        self.dlg = goodNeighborDialog()
        # Declare instance attributes
        self.actions = []
        self.menu = self.tr(u'&goodNeighbor')

        self.toolbar = self.iface.addToolBar(u'goodNeighbor')
        self.toolbar.setObjectName(u'goodNeighbor')
        self.dlg.comboBox1.currentIndexChanged.connect(self.getcolumns)

then I have written the following function

def getcolumns(self):
    print("HI")
    self.dlg.comboBox2.clear()
    layer_name = self.dlg.layerCombo.currentText()
    print("you have selected " + layer_name)

The problem is, the function "getcolumns" is not triggering at all.


texts:
I'm trying to reinitialize my map upon modal open. But it seems that after the modal open all I can see is the map controls but the other layers is not visible. Below is my code

            Loading please wait

Modal markup

Javascript

var map = new ol.Map({
    target: 'map',
    controls: ol.control.defaults().extend([
        new ol.control.FullScreen()
    ]),
    layers: [
        new ol.layer.Tile({
            source: this.source
        }),

        new ol.layer.Vector({
            source: this.marker_layer
            // opacity: 0.7
        })
    ],
    loadTilesWhileAnimating: true,
    view: new ol.View(this.view)
});
$(document).ready(function(){
    $('.modal-container.map-modal').html($('#map_container').html());
    openModal();
});

function openModal()
{
  $("#map-modal").modal('show');
}

$('#map-modal').on('shown.bs.modal', function(){
     map.updateSize();
});

Everything is working fine if I'm viewing the map on first load and not on the modal. But if I try to implement and add the map content in a modal and try to view it by trigger the modal show it's not displaying any information on the map except the controls


texts: What are some examples of interesting zoom slider customisations?

texts:
The default Claro zoom slider control is pretty boring.

It's also hard to see on top of many basemaps:

Are there any examples of some nice customisations I could use for inspiration?


texts: How to dynamically determine a pixel size for raster creation?

texts:
I have a GeoDjango web service that allows a user to upload a las file (v1.2). I can derive the extent of the point cloud coverage from the file using laspy:

from django.contrib.gis.geos import Polygon
from laspy.File import File
las_file = File('some/las/file', 'r')
xmin = las_file.header.min[0]
ymin = las_file.header.min[1]
xmax = las_file.header.max[0]
ymax = las_file.header.max[1]
bbox = Polygon.from_bbox((xmin, ymin, xmax, ymax))

...from this polygon's extent I would like to know its map scale in cm:m (projection is EPSG:3857) so I can use Waldo Tobler's rule of resolution (i.e. resolution/cell size = scale/(1000*2)) to create a raster of the point cloud.

What is the best approach here? I thought maybe creating a map object that is zoomed to the poly then accessing a scale property (e.g. scale = map.scale()) would be a good method but do not know of a python API available to do this... I see that QGIS for python has a scale calculator but am not sure how to implement with my project.


texts:
I have a dataset with approx. 14.000 observations (with an ID number and GPS coordinates). I have a plugin in QGIS from the Danish "Kortforsyningen" which can show all 98 councils in Denmark and their borders. Can I make a new variable that indicates which council the observation occurred in?
I am totally new to QGIS.

It is a layer from the plugin (I think). I tried the vector but I can only choose the dataset I uploaded to qgis and not the layer from the plugin.


texts: Can I import the result of calculation from other computer language into QGIS?

texts:
I try to make a kind of plug-in function in QGIS. The problem is my code is too hard to execute with only Python. The original my code is for Fortran, So I am looking for the method to connect 'QGIS and Fortran', or 'Python and Fortran'. Can  QGIS, or Python import the result of Fortran?

If it is possible, please tell me how I can find the method.


texts: Error connecting to SDE 10.3.1 on Oracle 12c from 10.1 client

texts:
We are currently planning an server migration.
We have our current server on SDE 10.1 on Oracle 11
Currently our editors are on ArcGIS 10.1 with Oracle client 11.2

Our new server is setup and ready for testing. It is at SDE 10.3.1 on Oracle 12c. However when ArcGIS Desktop existing clients try to connect to it they are getting an error:

  Failed to connect to database. Underlying DBMS error [unknown Error No
  extended error]

.

I had thought that newer versions of SDE were backwards compatible with older ArcGIS desktop clients. Is there a connection setting that has to change? The connection settings we are using work fine with ArcGIS desktop 10.3.1 :


texts: How to set WMS reprojection configuratation in MapServer if creating virtual map (e.g. star map)

texts:
I want to use OpenLayers with MapServer to create map of stars, but I don't know how to set up the WMS configuration in MapServer, especially the EPSG re-projection aspects.

In fact, I didn't get any re-projection, and I just want to get MapServer to provide a WMS and communicate with OpenLayers.

Can anyone give some advice?


texts: Meaning of exclamation mark in Python parser of ArcGIS Field Calculator?

texts:
In the following line, I don't understand what those exclamation marks mean? And why put everything in quotation?
I don't understand the purpose of the variable expression, please explain to me as I'm new to python

expression = "crossing(!CROSS_ROW!,!ROW_SCORE!)"

codeblock = """def crossing(crosses, row_score):
            if crosses != 0:
                return 5
            else:
                return row_score"""

The code gives a score to pipes (from pipe layer) that cross, or passes next to roads (from road layer) depending on the width of the road. this was the code-block that assigned a score of 5 if the pipe crosses.


texts: I have a polygon with a dashed line type; when viewed in ArcMap the line type appears correct however when I print to pdf the line type does not look correct.  This might be a pdf quality problem however I am inclined to think that this is an issue within ArcMap.


texts: Using expression string builder to ignore NULL values in QGIS?

texts:
Using QGIS 2.2, I would like to create a rule-based filter whereby you add 2 columns together and you get a certain colour as a result. However, some fields in Column_1 may be NULL and those exact same fields may have values in Column_2 and vice-versa.

Is there an expression to add the 2 columns whilst ignoring the NULL values or atleast treating them as zero?

The following is the logic I am trying to achieve:

1 + 2 = 3

1 + NULL = 1

NULL + 2 = 2

Additional info: The data from the columns are JOINED from other layers, I do not want to create any new columns as I am wanting the colours of layers to dynamically change when the user adds or removes the JOINED layers.


texts: Creating "distance to 1000 m contour" raster from bathymetry data?

texts:
I'm working with a bathymetry raster for the coastline of British Columbia.
Data found here: http://bcmca.ca/datafeatures/eco_physical_bathymetry/

I would like to create a new raster that shows the distance to the 1000 m isobath for any given cell.

I know how to create a line feature from the bathymetry raster that depicts the 1000 meter isobath, but I don't know how to create a raster of the distance to the isobath.

My main problem is that the original bathymetry raster has a very unusual shape (because of edges, coastlines, etc), and I would like to mimic the shape and retain NA values in my new raster.

I've tried the following in ArcMap 10.3

I used the "Contour List" tool in Spatial Analyst to create a polyline of the 1000 meter contour
I then used the "Euclidean Distance" tool to calculate distance to the polyline. The problem with this, is that the resulting raster is a square that does not match the bathymetry raster.

I would like to keep the outline the same, and keep the landmasses and islands as NA values, which makes me think R might be more appropriate.


texts: Determining the Unit of Spatial Resolution of a raster image in Python

texts:
I have some raster images, and I would like to determine the GSD using Python.
I know that I can use rasterio.transform()  or gdal.GetGeoTransform()  to extract the spatial resolution of the image.
How do I determine the units of the spatial resolution.


texts: raster algebra in python with rasters of different extents

texts:
I am trying to find out how to use GDAL & numpy modules to average a set of rasters....which are Sigma0 values from satellite passes at different times within a year.

Each raster has been mosaicked from a number of smaller images using GDAL_merge.  Because the orbits differ each time they pass over the area of interest the merged datasets are different extents and not regular squares.

So I want to average the values from each pass....baring in mind that when theoretically stacked on top of one another, there is sometimes overlaps of one/two/three images.

I imagine the best way of me getting around this is making all rasters the same extent ... and using a 'no data' value for areas of the raster where there is no data...and then ignoring these values during the calc of the average...

If this indeed the best way, how do I go about making them all the same extent when they are not regular (rectangle)? ...or is there a better way than this?

I am new to using GDAL/numpy ....my impression is that calculations using multiple rasters is best done in numpy arrays? again, is this correct.

Thank you in advance

Becky


texts: Expedite Near function in ArcMap 10.7 for 10^9+ coordinates?

texts:
I want to find the geodesic distance between the closest hydrography feature to each of my lat/long coordinates.

I have hydrography data from New York state in a shapefile. I have many points, 10^10 number of coordinates in WGS1984 datum. There's about 20,000 features in my hydrography data which was originally in NAD1983.

I'm trying to find a way to expedite my code. This is what I've tried:

Near function in ArcMap: This worked reasonably well when I used roads (about 10,000 features). It still takes about a week but is taking appears to be taking forever with hydrography.

Potential Thoughts:

I've converted all of my hydrography features to WGS 1984 to work with it. Should I consider converting both files into planar coordinates? I'm not sure I understand well enough whether converting from unprojected to projected would cause any potential problems.

I've tried methods in both ArcMap or R, I'm open to either and just want the fastest way to process all of these points. I've written a second question in the event somebody has a better method in R.

Expedite Near function in R for 10^9 coordinates?


texts: Getting geotiff information into variables, not files, using gdal_translate, gdalinfo

texts: I received an excellent answer to my question of how to get the lat/lon coordinates of the corners of a geotiff file.  I used gdalinfo.  The lat/lon info comes out into a file.  Similarly I turned the geotiff file into a bmp file using gdal_translate thanks to work colleague in another city who is hard to get hold of.  It would be much better for me if I could get the bmp file directly into memory, and the lat/lon coordinates directly into C++ variables.  Can anyone give me advice on how to do that?


texts:
I worked a complete night in a project involving a research of my group. When I tried to open it today, it's blank, there are no layers at all. As you can see in this link the thumbnail in the home screen of the projects (it's the top one) looks normal, but when I open it, it's blank.

Can you open the .qgz project at this link, and maybe check its integrity and get a hint of what could be wrong?

I'm working with QGIS 3.2 in a Windows 10 64 bits. All my other projects are opening just fine.