texts: Source controlling Esri Web AppBuilder Widgets and Themes

texts:
I'm not a JavaScript kind of guy but I'm trying to get ramped up in advance of some retirements of the people that have handled our web mapping applications (but whose savvy to source control ranges from 'not very savvy' to 'completely unaware of its existence').  I followed this video's instructions for using Yeoman/grunt to put these things under source control, but now my source control system finds over 6000 new files, the vast majority being in the node_modules folder (see screen shot below).
Can I configure source control to ignore everything in the node_modules folder?  Should I commit those files that are not in that folder (or should I limit what's in source control just to the widgets and/or themes folders)?  Must I re-do this scaffolding process for each widget and/or theme I want to source control, or can I place all widgets & themes inside the respective folders within the framework I just scaffolded?


texts:
Traceback (most recent call last):
              File "C:/Users/Haimwant/.qgis2/python/plugins\VTerrain\VTerrain.py", line 409, in run
                os.spawnl(os.P_NOWAIT, directory + "Enviro", "-terrain=" + terrain)
              File "C:\OSGEO4~1\apps\Python27\lib\os.py", line 608, in spawnl
                return spawnv(mode, file, args)
            OSError: [Errno 2] No such file or directory


texts: QGIS - Save not working after copy-paste between layers

texts:
I am trying to copy points from one layer to another in QGIS, both shapefiles, both with the same schema, both point files, both with the same Coordinate Reference System. The shapefile was originally created from a .KML

They appear to paste, including with the right attributes but when I go to save - I get the following error.

  Provider errors:

  OGR error creating feature -43: Attempt to write non-point (MULTIPOINT) geometry to point shapefile.


texts: In ArcMap 10.3 when making a feature record I am getting different values than I have in the domain, why?

texts:
I have a feature class in a GDB of road survey points, it has a domain assigned to the field of "Type".  When I look at the domain values in the GDB properties I see the entry code="Culvert - Proposed" and it's description is "Culvert - Proposed".

When I start editing on that feature class and go to create a feature I see in the create features window the icon for that layer with the text "Culvert - Proposed".  I select that and create a point feature but when I look at the attribute values for the new feature I see the "Type" attribute as "CulvertProp".

I can't seem to find where this other value comes from as I would expect it would be "Culvert - Proposed" as I see in the domain.

Any leads where it could be coming from?

I inherited the GDB so not sure how that was set up.


texts: Publishing map services in GeoServer like ArcGIS for Server does?

texts:
I was working with arcgis platform, but now I am working with geoserver for a project. Argis server publishes the MapServers and FeatureLayers under mapservers. For exapmle: Sample Demographic MapService is like this,

Can I publish map services in geoserver like this? I have seen WMS services in geoserver admin panel. Should I publish all database tables as a WMS layer?


texts: ArcGIS Visual Studio IDE Integration Framework?

texts:
i need to integrate arcgis 9.3 with visual studio c# 2008 express edition.

i found the integration framework for 9.1 but no chance for 9.3 and i've seen a lot of questions on web about it.

What should i do to integrate?

the version of .net is 3.5


texts: Leaflet WMS GetFeatureInfo gives result only on zoom level 10

texts:
I am using GetFeatureInfo with WMS layer to get the data behind. The request returns data only after zoom level 10 before that it returns empty features.

Does anyone having same issue?

I think it is not calculating correct  X & Y until zoom level 10. If I look same on the OpenLayers demo viewer which comes with GeoServer it gives correct result.

Environment: -Leaflet 0.7.2 with GeoServer 2.5.1 serving WMS

Request sent on zoom level 9:

Request=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&Layers=maps:dataLyr&SRS=EPSG:4326&BBOX=-163.8720703125,70.85998776061674,-159.2578125,71.67057415064292&SERVICE=WMS&width=1680&height=919&QUERY_LAYERS=maps:dataLyr&INFO_FORMAT=application/json&FEATURE_COUNT=50&&version=1.1.1&X=682&Y=388

Request sent on zoom level 10:

Request=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&Layers=maps:dataLyr&SRS=EPSG:4326&BBOX=-162.96295166015625,71.09942906866509,-160.65582275390625,71.50400873687697&SERVICE=WMS&width=1680&height=919&QUERY_LAYERS=maps:dataLyr&INFO_FORMAT=application/json&FEATURE_COUNT=50&&version=1.1.1&X=701&Y=390

Result on zoom level 10:


texts: Buffer GeoPandas dataframe based on a column value

texts:
I have a GeoPandas dataframe with a series of polygons in the geometry column. I also have a bufferdist column for each row containing an integer. The dataframe looks like

    bufferdist  geometry
0   600     POLYGON ((-122.9486846923828 48.65513944114847...
1   300     POLYGON ((-122.8642272949219 48.68053413474483...

How can I buffer each polygon in the dataframe to the distance of the bufferdist column?

I tried this

df['geometry'] = df.buffer(df.bufferdist)

but it returns the stacktrace

ArgumentError                             Traceback (most recent call last)
<ipython-input-36-555bbdbc0044> in <module>()
----> 1 df['geometry'] = df.buffer(df.bufferdist)

C:\Users\nickp\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\geopandas\base.py in buffer(self, distance, resolution)
    298     def buffer(self, distance, resolution=16):
    299         return gpd.GeoSeries([geom.buffer(distance, resolution)
--> 300                              for geom in self.geometry],
    301                          index=self.index, crs=self.crs)
    302

C:\Users\nickp\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\geopandas\base.py in <listcomp>(.0)
    298     def buffer(self, distance, resolution=16):
    299         return gpd.GeoSeries([geom.buffer(distance, resolution)
--> 300                              for geom in self.geometry],
    301                          index=self.index, crs=self.crs)
    302

C:\Users\nickp\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\shapely\geometry\base.py in buffer(self, distance, resolution, quadsegs, cap_style, join_style, mitre_limit)
    582                 'Cannot compute offset from zero-length line segment')
    583         if cap_style == CAP_STYLE.round and join_style == JOIN_STYLE.round:
--> 584             return geom_factory(self.impl['buffer'](self, distance, res))
    585
    586         if 'buffer_with_style' not in self.impl:

C:\Users\nickp\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\shapely\topology.py in __call__(self, this, *args)
     76     def __call__(self, this, *args):
     77         self._validate(this)
---> 78         return self.fn(this._geom, *args)

ArgumentError: argument 3: <class 'TypeError'>: wrong type

I'm sure I'm doing something wrong. Is there a better way?


texts: Finding the area contained within a section.

texts:
I'm doing analysis on some land in Blaine County, Oklahoma. I have a shapefile with the perimeter coordinates for all sections in Blaine and many different references to location. A few examples include:

S06 T13N R11W SE NW
S10 T16N R12W E2 NW
S34 T15N R11W SE NW L8

The first three values in these location references represent the section, township, range, and region and the remaining values are in a quad-tree notation that represents some plot on the section. For example, the first one reads: "the southeast corner of the northeast corner of section 6 of township 13N of range 11W" and the second one reads: "the eastern half of the northwestern corner of section 10 of township 16 of range 12W." The third reads: "the northwest corner of the southeast corner of section 34 in township 15N in range 11W." Note that the configuration of lots on the land is unknown (as far as I know) so we discard the last value.

I'm wondering if there is some pre-built method that can give me the approximate location that is being described by these entries. The inputs to the method would be some representation of the information provided in the entries excluding the section/township/range metadata and the coordinate perimeter of the section that is described by the section/township/range. It's definitely possible to solve this problem, but I don't want to bother with rotating the sections, creating a parser for the notation described, and coding all the geometric logic by hand, so I'm looking for something easier.

Any ideas?


texts: Python - Mask raster array using shapefile or rasterio

texts:
I have a raster that I have resample using rasterio, where img.shape is (5490, 5490)

if img.res[1] == 20:
      img = img.read(
      out_shape=(img.count, img.height * 2, img.width * 2),
      resampling=Resampling.nearest)

The Resampling function of rasterio is giving me the result as an array

img
array([[[2014, 2014, 1999, ..., 1705, 2136, 2136],
        [2014, 2014, 1999, ..., 1705, 2136, 2136],
        [1997, 1997, 1947, ..., 1709, 1769, 1769],
        ...,
        [1871, 1871, 1975, ..., 1868, 1966, 1966],
        [1817, 1817, 1892, ..., 1824, 1870, 1870],
        [1817, 1817, 1892, ..., 1824, 1870, 1870]]], dtype=uint16)

However, in my next step I want to use rasterio again to mask my raster with a shapefile using the following code:

out_image, out_transform = rasterio.mask.mask(img, features, crop=True)

This is not working as the input for mask  (img) is not a rasterio object but an array.

AttributeError: 'numpy.ndarray' object has no attribute 'nodata'

What should be the procedure in this case. From other posts I have seen that an option would be to rasterize my shapefile and read it as an array but I would like avoid work-around solutions.


texts: Last record in the program in PyQGIS is not executed properly

texts:
layer = vlayer4

provider = layer.dataProvider()

areas = [ feat.geometry().area()
          for feat in layer.getFeatures() ]

field = QgsField("area", QVariant.Double)
provider.addAttributes([field])
layer.updateFields()

idx = layer.fieldNameIndex('area')

for area in areas:
    new_values = {idx : float(area)}
    provider.changeAttributeValues({areas.index(area):new_values})

This program runs properly and gives the desired results. However, it fails to execute to calculate the area of the last feature in the polygon shapefile. I have a polygon shapefile with 516 features. It rightly calculates the area of 515 features but terminates there and don't give the area of 516th feature.


texts:
How can I automatically load a table stored on a network share into SDE when the original table is edited?

Environment is ESRI 10.1 ArcSDE on SQL Server.
Preference for python or existing GP tools.
Table would be a csv or xlsx.

Any ideas, info, or pointers would be helpful.


texts: Export one attribute field of SELECTED FEATURE from QGIS to a .CSV file using Python

texts:
I found different Python code, which could export all the list of attribute list from QGIS to a .txt or .csv file.

But, now I am creating a project where it is needed to export just ONE Attribute of ONE FEATURE (which it is selected for example).

Is it possible?

PS" Here Export one attribute field from QGIS to a .TXT or .CSV file are some example of exporting all the list of attribute table


texts: Removing select rows from display without removing from layer?

texts:
I have a layer with a field of image_quality that is marked either good, fine or poor. I also have 4 fields for sediment type: mud, gravel, boulder, outcrop.  I want to display the sediment types together in a pie chart but I only want to display those rows with fine or good images_quality.

Is there a way to exclude the rows with poor image quality from the display without fully removing them from the layer?

I realize I could easily create a new layer of only good and fine image quality but I'd rather keep the entire dataset complete in case I want to include all rows in a future display.

To summarize: How can I keep select rows from displaying without removing from the layer?


texts: Failed to Rebuild Indexes[Underlying DBMS error]

texts:
I am trying to rebuild indexes on a feature class and standalone table within ArcMap 10.2.1 and its giving an error which says:

  Unable to rebuild indexes[Underlying DBMS error]

All other indexes rebuild fine except on this feature class and standalone table. The two have no relationship with each other.I use an Oracle database.

I've tried researching this error but nothing is helpful.

Does anyone know how to resolve this issue?


texts: I want to duplicate a layer and then delete some polygons from the duplicate only, without deleting them from the original layer. Is this possible?


texts: PostgreSQL Queries pgAdmin versus Function call

texts:
I'm attempting to write a spatial query function that identifies the records associated with a specific spatial geometry at some area criteria

Firstly, when I execute the following command in pgAdmin I do receive results. Here is the command:

    SELECT *  FROM temporary.table1 WHERE
        public.ST_Area(public.ST_GeogFromWkb(geom))/1000000 <= area;

When I add the SAME SELECT to my function which is called from VB.NET code through our Devart PostgreSQL library I receive the following error:

spatial_ref_sys not found

This usually indicated one has used a postgreSQL function that requires specifying an SRS.  The function ST_GeogFromWkb has ONE (1) functional prototype  which can be called -- one without the SRS. Our geom column values are in WKB format hence I am using the aforementioned function. The ST_Area also takes only one argument -- the geometry. So I'm not sure why I'm receiving the SRS error.

Note: the function below was created using the pgAdmin properties GUI for creating a function.

The function _fselectbyarea(integer):

   CREATE OR REPLACE FUNCTION _fselectbyarea(area integer DEFAULT 100)
        RETURN SETOF table1 AS
   $BODY$BEGIN
       RETURN QUERY SELECT *  FROM temporary.table1 WHERE
       public.ST_Area(public.ST_GeogFromWkb(geom))/10000000 <= area;
   END;
   $BODY$
   LANGUAGE plpgsql STABLE
   COST 100
   ROWS 1000;

   ALTER FUNCTION _fselectbyarea(integer)
        ORDER TO user_group;
        COMMENT ON FUNCTION _fselectbyarea(integer) IS 'my comment here';

Granted there are come concerns with the function above...
a) When I remove the default ROWS and COST values the GUI will still include them in the resultant sql. These are default values which cannot be controlled.
b) I elected to use STABLE as the volatility mode since I'm querying one table.

Assumptions:
I assume when I run the SELECT in pgAdmin there must be an assumed SRS so it executed when I execute the GeogFromWkb function. However when I execute the function above there is no SRS specified so I receive the error: spatial_ref_sys not found. I'm thinking that when I run the SELECT in pgAdmin the SRS is set in the environment so it works; however, when I execute the function the environment has no knowledge of an SRS and errors.

When the function is called I am executing the query for ANYWHERE on the earth so I can't pin point my SRS to a specific UTM zone when I make a function call from the application. I do have code that takes Lat/Lon and computes the UTM zone but I was trying to avoid doing additional computation to compute the UTM zone. If I must use it I'll just have to create a lookup table to get the PostgreSQL SRS id.

Questions:
Is my assumption correct about the resultant SRS error I receive?
Any tweaks to my function which would improve the query?


texts:
Using QGIS 3.10 I need to select all points that have the word fium and its variace like fiume, fiumara, FIUME, etc.
The name of field is toponimo, I've used this query:

"toponimo"  = '%fium%'

But I've zero results and this is not correct because I see a lot of rows that have this information.
What is the right way to solve my problem?


texts: qgis 2.8.1 date filter gives incorrect selection results

texts:
I am running QGIS 2.8.1 on ubuntu 14.04 x64. I applied a date filter to a shapefile using the layer Properties_General "Query Builder" button. So the query was

 "LOCATION START DATE" >= '01/01/2014'

The selection does filter out a bunch of objects, however in the selection results I am still seeing objects with dates before 2014. I am not sure why that is.

I even tried to use a function like:

 todate("LOCATION START DATE") >= '01/01/2014'

but that gave me an error.

Is there something I am missing to get a working date filter?


texts: What User Testing techniques do you use?

texts:
In producing dynamic maps for students/users I have found the time invested in user testing well worth it.  I use a varient of think aloud protocol called hallway testing.  I grab any 2 or 3 likely users for 20 minutes each and set them a sample task (its important to get them to do something rather than just comment).  They explain what they are doing when they get stuck or find something confusing and I prompt them if they aren't saying anything.  Its a great way to discover consistent issues users have with your maps, most major problems will pop up with 3 users.

I use software to record the screen (silverback) but just taking notes was pretty effective.  With a big project I also advocate 'test early, test often'.

I've found clients to be unhappy about funding user testing but its so quick and low tech that I tend to do it anyway to make sure there aren't unknown issues with a project

Do you use user testing when producing dynamic maps?
If so, what techniques have you found to be effective and why?


texts: Shapefile disappeared from layout view and its symbology changed after updating data source?

texts:
I am trying to update a map based on a pre-built mxd template. However, after everything ran successfully (python code below), the shapefile that was updated did not show up on the map. Its symbology was also changed from "Quantities: Graduated colors" to "Features: Single symbol".

What did I do wrong?

Steps that I did:

Read the original shapefile in the mxd template.
Copied that shapefile to a new one.
Added a csv file then joined it with the newly created shapefile.
Updated existing field in the new feature with the values in the csv file.
Change the data source from the original shapefile to the new one.
Refreshed TOC and ActiveView then exported to a new mxd file.

I opened the new mxd file. The data source is correctly updated to the new file. Values in the attribute table were also correct but the shapefile did not appear in the layout view.

import os
import ntpath
import arcpy
from arcpy import env

arcpy.env.overwriteOutput = True

### set project directory
project_dir = os.path.expanduser('~/Projects/')
mxd_dir = os.path.join(project_dir, 'GIS/mxd/')
gis_dir = os.path.join(project_dir, 'GIS/shapefile')
env.workspace = os.path.join(project_dir, gis_dir)

year = '2019'
dframe = 'Baseline'
csv_file = 'sample.csv'

### open mxd template file
mxd_file = "my_template.mxd"
full_path = os.path.join(mxd_dir + mxd_file)
mxd = arcpy.mapping.MapDocument(full_path)

### list data frame in the mxd file
df = arcpy.mapping.ListDataFrames(mxd, dframe)[0]

### list layers
layers = arcpy.mapping.ListLayers(df)

### this is the shapefile in the template with a customized legend/symbology
inFeatures = os.path.join(gis_dir, "Q_" + dframe + ".shp")
print(inFeatures)

### make a copy
outFeatures = os.path.join(gis_dir, "output", "Q_" + dframe + "_" + year + ".shp")
arcpy.CopyFeatures_management(in_features = inFeatures, out_feature_class = outFeatures)

### join then do field calculator on the new feature
arcpy.MakeFeatureLayer_management(in_features = outFeatures, out_layer = 'new_lyr')
arcpy.MakeTableView_management(in_table = csv_file, out_view = 'csv_ec')
arcpy.AddJoin_management(in_layer_or_view = 'new_lyr', in_field = 'ID', join_table = 'csv_ec', join_field = 'ID')
arcpy.CalculateField_management('new_lyr',
                                "Q_" + dframe + "_" + year + ".Q", "!" + "Q_" + dframe + ".csv" + ".Q_new!",
                                "PYTHON")
### remove all joins
arcpy.RemoveJoin_management('new_lyr')

### update data source
for lyr in layers:
    if dframe in lyr.name:
        lyr.replaceDataSource(os.path.join(gis_dir, "output", dframe), "SHAPEFILE_WORKSPACE",
                              os.path.splitext(ntpath.basename(outFeatures))[0])

### update Layout View
arcpy.RefreshTOC()
arcpy.RefreshActiveView()

### save to new mxd file
new_mxd = "new_Q_" + year.upper() + ".mxd"
new_mxd_path = os.path.join(mxd_dir + new_mxd)
mxd.saveACopy(new_mxd)

### clean up the MapDocument object by deleting it
del mxd


texts: lidR: Save LAS files from a clip_roi list

texts:
I have clipped a point cloud with a shapefile containing multiple polygons, using clip_roi() function. The result is a list of LAS files. However, when I try to loop through the list and save each individual file, I get Error: Argument is not a LAS object. Here is the code:
las = readLAS("plot_a3.las", filter = "-drop_z_below 0")
polys = shapefile("plot_a_segments.shp")
clipped = clip_roi(las, polys)

for (i in range(lengths(clipped)))
{
  file <-file.path('Plot_A', paste0('plot_a_', clipped[i], '.las'))
  writeLAS(clipped[i], file, index = FALSE)
}

How do I correctly save the output so that each clipped point cloud is saved as a separate LAS file?


texts:
I'm trying to open Vision Zero Data provided by NYC, but they've not provided any documentation or guidance.

Does anyone have any guidance? I'm ideally looking for such data in a CVS/excel type format, but am not sure whether this'll be available.

Files in the folder are .spx; .gdbtable and .gdbindexes

https://data.cityofnewyork.us/Public-Safety/Vision-Zero-View-Data/y74e-vkxy


texts: Need to include GPS data in a GIS system

texts:
I work for a small telematics company and we received a request from one of our clients about integrating their vehicle GPS locations to their ArcGIS system.

Our current system simply displays this location data on Google Maps through JavaScript.  I'm not really familiar with GIS, but I began doing some digging. From the best I could grasp, I need to write a web service that their GIS server can access in order to add it to the maps.

Our system uses a MySQL database that holds the data sent to it by the GPS devices. If a GIS map could derive the information straight from the database, that would be fine. The only real thing at that point would be how to define where the GIS server would look for the information. The data stored in the database is very expansive and contains a lot of information that is not pertinent to the map location.

Is a route that can be taken?
what's the best way to go about connecting a GIS server to retrieve
information from our MySQL database?


texts: Query Data from an Event Table in ArcGIS (Linear Referencing)

texts:
My goal is to store a bunch of past present and future Events in a central place from different vehicles, query those tables on demand and display the result in ArcMap. Note that right now, my Route Reference is a shapefile stored locally

I have started small by loading a simple excel file containing Events and I could display them rather easily using Display Route Event in ArcMap. Unfortunately, I cannot query this table because the table doesn't have an Object-ID (error message from ArcMap). The only option is to convert the table into a shapefile or feature class. By doing so, not only does it add an extra step but I also lose the "live feed" from my table which is something I have to keep.

I have tried with a DB Connection (data have been loaded into an SQL Server instance) hoping I could Add Query Layers to be displayed as route event as well. I'm running into some issues there as well (licence level related I think) but it seems to be the way.

Maybe there's a better solution to reach my goal within ArcGis or QGIS. I could establish a connection between QGIS and SQLSERVER but couldn't find a way to query the database (tried through DB Manager but only spatial lite and postgis available). I guess the ideal is to have everything stored in Postgres postgis and use DB Manager. Unfortunately I have to work with SQL Server


texts: When to use Clip Output to Graphics Extent in ArcMap?

texts:
I am using ArcGIS Desktop 10.

When would one use this check box when exporting a map? I never use it, but I see it.

Here's the check box, it shows up when you're in Layout view and go to File > Export Map:


texts: How to create 3D globe images highlighting a specific country or 2D country map with capital?

texts:
I am building an Anki flashcard set that should contain country flags, names and (ideally) a 3D globe with the country outlined, as can be seen on Wikipedia.

I've already completed the part that extracts all the information from the Wikipedia page listing all countries, and I've written a tool that extracts country outlines from an SVG file that has the shapes for all countries and renders them into a bitmap.

Unfortunately, the polygon outlines in this SVG file are extremely crude, so it makes little sense to use them for the cards. Additionally, I'd prefer beautiful rendered globes with the countries highlighted as in the Wikipedia examples, or a flat map with cities (would be cool to have both maybe).

I'd be happy to have a simple method to download/create/extract globe images with whatever tool necessary, I'd prefer something that can be integrated into a project where the map is queried using ISO-3 codes. So:

Is there a page where maps could be downloaded using the ISO code? I tried using the Wikipedia images but they are not named in a fashion that makes it easy to download them using the ISO code.
Could this be achieved using QGIS? Possibly using a script?
Can this be achieved using LaTeX? I remember that I have seen some examples rendering a globe with it, but I cannot find the page anymore.


texts: Losing georeference when creating PDF maps using QGIS on a new Mac

texts:
I have been using QGIS and my PC to make georeferenced maps for Avenza.

I have recently switched to a Mac Platform. It all seems to work same except when exported the PDF is not georeferenced.  All seems to be spatially correct when creating maps.

Is this an issue with how Mac downloads our georeferenced USGS imagery we use, which seems to be the only thing that doesn’t seem the same as the PC, or is there something else going on we don’t have setup correctly ?


texts: Combine XY Coordinates with JPEG to make GEOTIFF

texts: I have a collection of 750 high-res jpeg images that are not geo-referenced, but for each of these images I have the center point coordinate as a shapefile. How can I merge these two so that I make a geotiff that uses each of those center XY coordinates to make a geotiff that I can than load into QGIS/ArcGIS?


texts: Anyone know how to generate a street index for a map with accompnaying page numbers that are data driven? I am use the toolbox for creating the street index but exports to PDF however I need it to be in a csv file or excel. I have converted the PDF created file into excel but it is too messy and difficult to clean.


texts:
I am working on an exhibit/geospatial visualization which shows the migration of marine animals over time throughout the year. I am searching for seasonal satellite map tiles. Does anyone know of any?

For now I am using Mapbox's satellite tiles.


texts: Exporting one to many relation in QGIS to new shapefile?

texts:
I am using QGIS 3.4.1-Madeira.

I have a base layer map that represents areas as polygons. I have created a CSV file with many entries of different NGO projects, and each one is coded with the ID of the spatial area it takes place. I understand I can't do a simple Join because it only joins one row of the CSV to each area polygon. I have set up a Relation in the Project Properties, which reflects the data structure I want, but I can't figure out how to make it just display in the map as a new layer.


texts: ArcObjects - IFeature HasOID property returning false when there is clearly an OID

texts:
When inspecting features in my featureclass, I am checking to see if a feature has an OID using the HasOID property. Even though the feature(s) clearly has an ID on visual inspection (via ArcMap), the property is returning false. When inspecting the value for the objectID it is reporting nothing.
The featureclass is stored in an SDE instance on SQL Server. The ObjectID exists in the featureclass and is populated when viewing in ArcMap.


texts:
I generated a GeoJSON from a table in EPSG:WGS84 in postgis

SELECT ST_AsGeoJSON(geom) FROM "onibus"

I put this file into the www folder on my server. I'm running geoserver locally. My pages are also in the folder wwww.

I get three errors:

  Uncaught TypeError: Cannot read property 'wrapDateLine' of null
  OpenLayers.js:197

  XMLHttpRequest cannot load file:///C:/Program%20Files/GeoServer%202.4.5/data_dir/www/featureCollection.geojson.
  Received an invalid response. Origin 'null' is therefore not allowed
  access. mapGeoJson.html:1

  Uncaught TypeError: Cannot read property 'projection' of null mapGeoJson.html:28

This is my code:

<!DOCTYPE html>
<html lang='en'>
<head>
 <meta charset='utf-8' />
 <title>My OpenLayers Map</title>
 <script type='text/javascript' src='OpenLayers.js'></script>

 <script src="http://maps.google.com/maps/api/js?sensor=false"></script>

 <script type='text/javascript'>

 var map;

 function geraMapa() {

     map = new OpenLayers.Map('map_element', {});

    vectorLayer = new OpenLayers.Layer.Vector("GeoJsonLayer");
    map.addLayer(vectorLayer);

    function handler(request) {

        var geojson_format = new OpenLayers.Format.GeoJSON({
            'internalProjection': map.baseLayer.projection,
            'externalProjection': new OpenLayers.Projection("EPSG:4326")
        });

        vectorLayer.addFeatures(geojson_format.read(request.responseText));
    }

    var request = OpenLayers.Request.GET({
        url: "featureCollection.geojson",
        callback: handler
    });

    map.addControl(new OpenLayers.Control.LayerSwitcher({}));

    if(!map.getCenter()){
    map.zoomToMaxExtent();
    }
 }

 </script>
</head>

<body onload='geraMapa();'>

 <div id='map_element' style='width: 1000px; height: 900px;'>
 </div>

</body>
</html>

Can anyone help me troubleshoot the errors?


texts: Embedding TTF in SVG doesn't work in SVG markers but in Layout text items

texts:
In my desparate aim to put everything inside a Geopackage file (mainly for use with the wonderful "input" app), I came across the situation where I wanted to store font files (TTF) inside my QGIS project.
While searching the Web, I found the SVG @font-face declaration which allows to embed base64 encoded truetype fonts:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
<defs>
  <style>
    @font-face {
        font-family: "myfont";
        src: url("data:appllication/x-font-ttf;charset=utf-8;base64,AAEAAAAPAIAAAwBwT1MvM ... NUjAwAAAAAAAA") format('truetype');
    }
  </style>
</defs>
<g>
  <text fill="#000000" stroke="none" stroke-width="0" x="1024" y="2048" font-size="2048" font-family="myfont" text-anchor="middle" xml:space="preserve">F</text>
 </g>
</svg>

This works like a charm in Layout text items, but unfortunately not in SVG markers.
Can someone explain why SVG markers refuse to read the style declaration here?
P.S. I‘m using QGIS 3.16.3 on Windows


texts: Iterating over selected features in QGIS Processing

texts:
I used to be able to iterate over selected features using the following script in v2.0.

import processing
features = processing.getfeatures(layer)
for feature in features:
  #Do whatever you need with the feature

However, this doesn't seem to work when I upgraded my QGIS to v2.2. Is there any new way on how to iterate selected vectors?


texts: Query to Display Polygons not Working on Geodjango-Leaftlet Web App

texts:
I am currently working on a Geodjango-Leaflet-OpenStreetMap web app. I have around 540000 polygons of property boundaries that were drawn in ArcMap; the polygons will be imported to the web app later through PostgreSQL+PostGIS. Recently, I have imported one polygon to the PG db.
There is a search bar on the web app. I want the user to enter a polygon's unique ID in the search bar, and the polygon to appear on the screen soon after.
However, after entering the polygon's ID at the home page, the site redirects me to the results page with no polygon.
How can I fix the code?
results.html
<!DOCTYPE html>

{% load static %}
{% load leaflet_tags %}

    {% leaflet_js %}
    {% leaflet_css %}
    <title>Home</title>

Welcome

{{ geo_json }}

<form action="{% url 'results' %}" method="get">
  <input name="q" type="text" placeholder="Search...">
</form>

{% leaflet_map "gis" callback="window.our_layers" %}

views.py
from django.shortcuts import render
from django.views.generic import TemplateView , ListView
from django.core.serializers import serialize
from django.http import HttpResponse
from django.db.models import Q
from app.models import test11

class HomePageView(TemplateView):
    template_name = 'index.html'

class search(ListView):
    model = test11
    template_name = 'results.html'

    def get_queryset(self): # new
        query = self.request.GET.get('q')
        object_list = test11.objects.filter(
            Q(objectid__icontains=query)
        )
        return object_list

def test11_datasets(request):
    test111 = serialize('geojson', test11.objects.all())
    return HttpResponse(test111,content_type='json')

urls.py
from django.conf.urls import include,url
from app.views import HomePageView, test11_datasets, search

urlpatterns = [
    url(r'^$', HomePageView.as_view(), name = 'home'),
    url(r'^test11_data/$', test11_datasets, name = 'test11'),
    url(r'search_results/$', search.as_view(), name='results'),

]

models.py
from __future__ import unicode_literals
from django.db import models
from django.contrib.gis.db import models
from django.db.models import Manager as GeoManager

class test11(models.Model):
    objectid = models.BigIntegerField()
    shape_leng = models.FloatField()
    shape_area = models.FloatField()
    geom = models.MultiPolygonField(srid=4326)

    def __unicode__(self):
        return self.objectid

    class Meta:
        verbose_name_plural = 'test11'


texts: Where to deposit global coverage dataset?

texts:
Some years ago I published a paper on Quarter Degree Grid Cells in the African Journal of Ecology. Quarter Degree Grid Cells (QDGC or QDS – Quarter degree Squares) is a way of dividing the longitude latitude degree square cells into smaller squares, forming in effect a system of geocodes. Historically QDGC has been used in a many African atlases.

I have now revised the files and made one export per country in the world. It is a lot of data and I am hesitant to keep it on my website. The file format is ESRI shapefiles.

I am considering using GitHub as a means of distributing the files. I keep the related code in a repository there. But the limit for a repository there is around 1 Gb and the files as a total easily gets to that size.

Users will usually need a national level data set, so it makes sense to keep the files in separate national folders. They could also be individually zipped down.

It should be easy for me to upload the files and to some extent also version them.

Where could/should I deposit such files? Is BitHub a relevant alternative? Where else?


texts: Adding WFS Connection using QGIS Modeler

texts:
I would like to ask if it is possible to setup a WFS Layer Collection connection to the QGIS Modeler or not?
Not loading in the WFS layer in QGIS first and then process it. But loading the entire WFS, or parts of it at least directly into the QGIS modeler and then process it.
You see we have a Available WFS connection with a lot of point and Polygon Layers. And while we have general method, to "order" (it is free to use data and free of charge) we would like to use this WFS, clip it to our boundary's (another polygon layer) and save it for later use.
The thing is this WFS is technically a database.
So it it possible by database connection?


texts: How to convert Geographic Coordinate system to Projected coordinate system INDIA for HEC-RAS without ArcGIS?

texts:
The DEM data is downloaded from https://bhuvan-app1.nrsc.gov.in/ website.
I want to use it for HEC-RAS project but it has a geographical coordinate system, how can I convert it to projected one without ArcGIS?
P.S. I have QGIS!
.prj looks like:
GEOGCS["GCS_WGS_1984",
        DATUM["D_WGS_1984",
              SPHEROID["WGS_1984",6378137.0,298.257223563]
        ],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]
]

It is a 3600*3600 pixel DEM 1 Arc sec with the following parameters:
<Upper_left>cX = 74E, Y = 18N </Upper_left>
<Upper_right>X = 75E, Y = 18N </Upper_right>
<Lower_right>X = 75E, Y = 17N </Lower_right>
<Lower_left>cX = 74E, Y = 17N </Lower_left>


texts: Determine Angle of Street by Parsing an Overpass-Turbo output xml

texts:
I am currently downloading all the street intersections from a bounding box using the query below (see it on overpass).

<query type="way" into="hw">
  <has-kv k="highway"/>
  <has-kv k="highway" modv="not" regv="footway|cycleway|path|service|track"/>
  <bbox-query e="9.1775" n="45.8428" s="45.7581" w="8.9904"/>
</query>

<foreach from="hw" into="w">
  <recurse from="w" type="way-node" into="ns"/>
  <recurse from="ns" type="node-way" into="w2"/>
  <query type="way" into="w2">
    <item set="w2"/>
    <has-kv k="highway"/>
    <has-kv k="highway" modv="not" regv="footway|cycleway|path|service|track"/>
  </query>
  <difference into="wd">
    <item set="w2"/>
    <item set="w"/>
  </difference>
  <recurse from="wd" type="way-node" into="n2"/>
  <recurse from="w"  type="way-node" into="n3"/>
  <query type="node">
    <item set="n2"/>
    <item set="n3"/>
  </query>
  <print/>
</foreach>

The output is a 92 pages doc (including duplicates) containing nodes(node id, lat and long). I am extracting the latitudes and longitudes in order to compose a Google Street View Image link because i want to download for each point the corresponding image. In the composition of the link I also want to calculate the heading-angle of the street;

I know the math formula needed but it requires 2 lat and 2 long (from 2 points in the same street) and my problem is that the nodes in the output file don't have a specific order. Therefore, i cannot calculate the angle between two consecutive nodes.

I was thinking of sorting the lat or long in asc/desc order because in this way i might find the points in the same street.
Is this method valid or i can solve it in an easier way? Is there any more efficient way to find all the street intersections?


texts: Merging small polygons with the biggest adjacent ones

texts:
I want to merge the RED polygons with the YELLOW polygons.
But i want to merge the one red polygon with the adjancent polygon with yellow one. This polygons are in one Feature class but classified in atributes.
I am trying many methods but it doesnt work or i dont know how to do.


texts: Loop over features of a GeoJSON object from CartoDB

texts:
I have just little knowledge about HTML and JavaScript. Nevertheless I was playing, copying and pasting around with Leaflet and CartoDB.

I want to display the features GeoJson in a table. This is what I tried.

var map = L.map('map').setView([51.0, 10.0], 6);

var base = {
"S/W" : L.TileLayer.provider('OpenStreetMap.BlackAndWhite'),
"TOP":  L.TileLayer.provider('Thunderforest.OpenCycleMap'),
"OpenStreetMap": L.TileLayer.provider('OpenStreetMap.Mapnik')
};

window.backupAlert = window.alert;
window.alert = function () {return true};
var alle = L.cartoDB('http://leak-my-brain.cartodb.com/api/v2/sql?q=SELECT * FROM jobsnew', {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconSize: [4, 4],
iconAnchor: [0, 0],
popupAnchor: [0, 0],
iconUrl: "http://www.zoowelt.org/wp-content/uploads/2013/02/viv_point.png"
})
})
},
 onEachFeature: function(feature, layer) {
layer.bindPopup('' + feature.properties.title + '
' + feature.properties.kw);
}
});

map.addLayer(base.OpenStreetMap);
map.addLayer(alle);

map.on( "zoomend", function( e ) {
    console.log( "zoom level is " + map.getZoom())
}); //zur ausgabe des Zoomlevels in der Konsole
var layersControl = L.control.layers(base,alle);
layersControl.addTo(map);
for (var key in alle._layers) {
  if (alle._layers.hasOwnProperty(key)) {
    backupAlert("hi comment");
  }
};
function writeTable() {
    var out = '';
    for (var row=0; row<1000; row++) {
    if ( typeof(alle._layers[row])=='undefined') continue;
        out += '
'
        + '' + alle._layers[row].feature.properties.title + '	' +
        + '' + alle._layers[row].feature.properties.kw + '	'
        + '
'
     }
     document.write(out);
 };

This somehow works but there are some issues. The main problem is that the indices in the alle are not starting at 0 and they are not increasing by the step size of 1.


texts: Variable width buffers depending on surface area (Arcmap 10.1)

texts:
I know this is a pretty basic question but I couldn't find the answer myself, so here I go:

I need variable buffer widths depending on the surface area of the polygon (city) size.

For example: A polygon sized 100 km2 should have twice the buffer than a polygon sized 50 km2 (which would be 500M radius in this example) Arcmap 10.1.


texts:
I have a created some point data using CRS ESPG:4326 and added Google base map from OpenLayers plugin. While adding the Google Maps imagery I have changed CRS to ESPG:3857 in project properties.

Then I opened default Coordinate capture plugin

Now I want to copy the coordinates to the clipboard wherever I click in the map window. I am facing a problem while copying coordinates, when I click on copy to clipboard it is capturing coordinate system also. How to avoid this problem and can I automate this option?

Is there any plugin that allow us to press any shortcut key then captures the coordinates where ever the mouse is? If not how can we edit this plugin and recreate a plugin that can help us to do the same using Python?


texts:
I am trying to find the XY coordinates that can be allowed with the tolerance of 2 meters.

In the above image, When the user(smiley) with GPS reach the ----- border line, the system should understand that user is in the coordinates (with tolerance of 2 meters). How to validate this?

Could anyone help me on this?


texts: I need a (free, no cost) shapefile for bathymetry of entire world, specifically from depths of zero to 200 metres, ideally in 50 or 100 m contour intervals. Has to be a shapefile. Help please!


texts: Arcpy GetRasterProperties returns odd results

texts:
I have this simple piece of python code to test whether a raster has integer values or not:

        res = arcpy.GetRasterProperties_management(ws, 'VALUETYPE')
        res = res.getOutput(0)
        if res > 8:
            print res

I run this in a loop for a number of rasters. Problem is, it prints out a list of 3's.

I'm guessing that the 'res' variable is not a single number at all and when you do a logical test on it, it looks at a certain attribute and when you print res, it prints a different attribute.

Can anyone explain how I should do this test properly?


texts: How do I conditionally increment buffer in PLPGSQL/PostGIS?

texts:
I have gone through some relevant questions but my problem is slightly different. I have two tables in my PostgreSQL 9.5 database i.e., line geometry (1 row) and point geometry (2 rows). The scenario is as follows:

As shown above, point 1 is closer to the line as compared to point 2. I would like to generate a small buffer around line and search for points on both sides by conditionally incrementing buffer until both points are found. To make it more clear,

start with buffer of 1 meter around line and search for points
if point is not found then increment buffer to 2 meter
if point on one side is found keep track of it and increment the buffer to 1 meter more to search point on the other side
if both points are found, stop buffering and return line with both points with their distances

I am specifically looking for, but not restricted to, PL/PgSQL solution. Can someone suggest me to have some pointers towards my desired output?

Update:

The main purpose to do this is to calculate the distance between opposite points (schools for example) on the same line (street). These schools could be multiple sometimes in the real world scenario and  can be on the uneven distances from the street. But, distance between only opposite points (schools) is desired. I did not want to put a limit on search distance from street that is the why I chose for the conditional increment of buffer from street until schools on both sides are found. Search distance could be around 50 meters or 100 meters but this will select schools on other streets as well which is not desired. Table line contains more than 50,000 rows and the process needs to be automated for all lines.


texts: Efficiently Calculating Farthest Point from Origin

texts:
I'm trying to find a clever/efficient way to calculate the the farthest point from an origin, given a list of lat,lng points.

For example, if trying to find the closest point from an origin I could adapt this function that finds all nearby points:

def getNearby(origin_dict, geo_dict_list, radius_miles):
    # adapted from http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL

    # this will create a lat+lng square
    # corners aren't technically correct, but the general idea:

    #    lat_1 ---> lng_1
    #      |          |
    #      |          |
    #      |          |
    #    lat_2 ---> lng_2

    # if geo point is inside our lat+lng square, then do expensive calculation of exact distance
    #   to see if it's inside the radius-circle w/in the square (circle not shown)

    # geo_dict_list = [ {'lat' : 1.234, 'lng' : 5.678}, ... ]

    offset = radius_miles / 69.1
    lat_1 = origin_dict['lat'] - offset
    lat_2 = origin_dict['lat'] + offset

    offset = radius_miles / abs( math.cos( math.radians(origin_dict['lat']) ) * 69.1 )
    lng_1 = origin_dict['lng'] - offset
    lng_2 = origin_dict['lng'] + offset

    return_indexes = []
    for index, geo_dict in enumerate(geo_dict_list):
        if (geo_dict['lat'] >= lat_1) and (geo_dict['lat'] <= lat_2) and (geo_dict['lng'] >= lng_1) and (geo_dict['lng'] <= lng_2):
            if getDistance(origin_dict, geo_dict, units="miles") <= radius_miles:
                return_indexes.append( index )

    return return_indexes

Is there a similar way to approach this for finding the farthest point from origin?  Or maybe there's a way to structure the original list in a way that allows one to do some clever sorting?


texts: Transform ellipse representation from major/minor (meters) to degrees

texts:
I am given an ellipse represented by a quadruple (major, minor, center, azimuth) where major,minor are the ellips's axis length in meters, the center is the WGS84 coordinates of the ellipse's center given in a (lat, lon) form. The azimuth is the angle of the ellipse relative to the north axis.

I want to transform this representation to one which uses degrees only. My attempt was to consider the earth a perfect sphere, and associate the major axis to the latitude distance and the minor axis to the longitude distance. Additionally, I take into account the latitude when computing the longitude distance (standard distance between two points on a sphere when one advances along the azimuthal axis). Unfortunately, when I draw the resulting ellipse's WKT, it does not match the original ellipse WKT.

I don't think that this difference is caused by the spherical assumption, but by a more serious flaw. One thought I had is that the major/minor are movements in meters along the ellipse's axes, which are not aligned with the polar/azimuthal axes (which are determined by the azimuth of the ellipse), in which case I have no idea how to proceed.

This seems like a rather trivial case, but unfortunately I wasn't able to find any references.


texts: OpenLayers doesn't apply style for KML file

texts:
I've used OpenLayers 4 to create a simple web map to load a KML file. I made a style for the KML file and also change "extraceStyle" of the layer to false, but it doesn't use my custom style.

var center = ol.proj.transform([51.34, 35.65], 'EPSG:4326', 'EPSG:3857');
var view = new ol.View({
    center: center,
    zoom: 2
});

// time zones layer style
var tzStyle = new ol.style.Style({
    stroke: new ol.style.Stroke({
        color: '#40c8c8',
        opacity: 0.5
    }),
    text: new ol.style.Text({
        font: '20px Verdana',
        text: 'TZ',
        fill: new ol.style.Fill({
            color: '#404040',
            opacity: 0.75
        })
    })
});

// KML of time zones
var tzSource = new ol.source.Vector({
    extractStyles: false,
    format: new ol.format.KML(),
    url: 'http://localhost:8080/OpenLayersAssets/timezones.kml',
    projection: 'EPSG:3857'
});
var timezones = new ol.layer.Vector({
    source: tzSource,
    style: tzStyle
});

var map = new ol.Map({
    target: 'map',
    layers: [timezones],
    view: view
});


texts: Can I export an imagery directly to a geo-referenced raster form File|Export Map in Arcmap?

texts: While using File|Export to export an imagery to raster, is there a way to have it geo-referenced in a way that if I load the exported raster into the map, the image sits exactly in its place without the need to use georeferencing toolbar/ defining the spatial reference?


texts: Can you query overlapping user-defined polygons at a given point in Google Maps?

texts:
I need to find out the limitation of working with the Google Maps API, and the possible solutions for doing semi-complex spatial comparisons.

What I'm looking to achieve is a system of comparison that will allow the querying of overlapping user-defined spatial polygons upon a given point (A residential address).

Basically, a restaurant will have a given delivery area who's parameter will be defined by X geo-coordinates. An address is represented by a single point (x, y).

I've been advised that the best back-end for these type of spatial comparisons is postGIS; however, upon reviewing the terms and condition set by the Google Maps API, it is not clear if you are allowed to store the geocoordinate response Google provides.

http://code.google.com/apis/maps/terms.html

10.1.3 - For example, you must not use the Content to create an independent database of “places.” ... yet,

..except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily, securely, and in a manner that does not permit use of the Content outside of the Service

My question(s) are:

Has anyone had any experience working with spatial polygons and Google Fusion Tables?

Has anyone had experience working with the Google Places API, does it enable these types of comparisons?

Because the geo coordinates are being captured when a Google Map is displayed, and then being stored to be used in conjunction with more complete Google Map, does this fall within the 'terms of use' laid out by Google?

I'm very keen on using Google Maps, with the prospect of subscribing to the premium service given the success of my application. Has anyone else had experience with these types of calculations, is there something that I'm missing?


texts: Finding values within intersecting polygons?

texts:
I have 2 shapefiles; one has income data on a block group level, the other has polygons showing utility providers service areas. I would like to know the income within each utility provider area.
Many of the utility service provider area polygons cross the block groups, therefore I know that only a percentage of the block group income can be attributed to the utility provider area. How do I calculate what percentage of the total block group income can be attributed to the service provider area?


texts: How to build polygons from buffered points and merge overlapping ones using R?

texts:
I have a sample of 3 groups of points which are similarly spread within their groups.

> pts
             x        y
 [1,] 453067.5 364073.5
 [2,] 453066.5 364072.5
 [3,] 453068.5 364072.5
 [4,] 453063.5 364071.5
 [5,] 453065.5 364071.5
 [6,] 453067.5 364071.5
 [7,] 453069.5 364071.5
 [8,] 453071.5 364071.5
 [9,] 453062.5 364070.5
[10,] 453064.5 364070.5
[11,] 453067.5 364065.5
[12,] 453069.5 364065.5
[13,] 453071.5 364065.5
[14,] 453073.5 364065.5
[15,] 453075.5 364065.5
[16,] 453077.5 364065.5
[17,] 453079.5 364065.5
[18,] 453054.5 364064.5
[19,] 453056.5 364064.5
[20,] 453058.5 364064.5

Then I can convert to sp object: pts_sf = sf::st_as_sf(as.data.frame(pts), coords = c(1,2)). Now trying to create buffer pts_buf <- gBuffer(pts_sf, TRUE, 2) but get error

  Error in (function (classes, fdef, mtable)  :    unable to find an
  inherited method for function ‘is.projected’ for signature ‘"sf"’

Other way round, I can use buffer like this pts_buf <- sf::st_buffer(pts_sf, 2) but now I get error when trying pts_uni <- rgeos::gIntersects(pts_buf, byid=TRUE, returnDense = FALSE)

  Error in RGEOSBinPredFunc(spgeom1, spgeom2, byid, func) :
  rgeos_convert_R2geos: invalid R class, unable to convert

I use pts_int = sf::st_intersects(pts_buf) but this is not an object I need. Can I find any compatibilities to go out with it?


texts: How does Spatial Join work under the hood?

texts:
I have a sidewalk_inspection points table  and a sidewalk lines table. I want to do a spatial join between the points and the lines so that I can assign the ID of the nearest sidewalk to the sidewalk_inspections.

However, it's occurred to me that I don't know how the spatial join works under the hood.

Does it:

  A. Join the points to the nearest vertex in the lines?
  B. Join the
  points to the nearest segment within a line?
  C. Join the points to
  the nearest centroid of a line (or centroid along a line)?


texts: What is the difference between Coverage, Shapefiles and Geodatabases in ArcGIS?

texts:
I was wondering about the difference in spatial data storage methodology used by Coverages, Shapefiles and Geodatabases in ArcGIS. Coverage was the initial format, followed by Shape Files and now Geodatabases. So what has improved in these newer formats of Shapefiles and Geodatabases?

It would be great if someone could please explain it with examples.


texts: Does leaflet support KML Ground Overlays?

texts:
I found an example showing KML overlays at http://harrywood.co.uk/maps/examples/leaflet/kml.html but it only plots vector layer using polygons.

Is there any way to plot Ground overlays of KML (like in http://kml-samples.googlecode.com/svn/trunk/kml/Region/GroundOverlay/usa-ca-sf.kml) in Leaflet?


texts: Generating confusion matrix using classified image with geotiff format?

texts:
I am working on yielding a confusion matrix with importing an image which is a geotiff format. After classified by a python program, The image has two values (two classifications). However, when I imported the image to ENVI, it warned the ENVI classification type only can be inputted. Before the above progress, I had used ENVI to create the ROI for the validation. I was going to use the ROI and the image to generate a confusion matrix with ENVI. But it was failed.

Is there any method which can produce the confusion matrix using geotiff format image and ROI?


texts: Getting units from ISpatialReference of ArcObjects?

texts: How do I get the units (meter/feet) from an ISpatialReference object in ArcObjects?


texts: Access object size from field calculator in print layout

texts:
I am creating a print layout in QGIS. I created a rectangle and I would like to fill it with a line pattern, in such a way that there are exactly five repetitions of the pattern through its height. However, QGIS enables me to choose the spacing, not the number of repetitions, so I would like to use the field calculator to specify height_of_this_rectangle / 4 as spacing.
The problem is that I don't understand how to access the height of the rectangle as a variable in the field calculator expression.


texts:
i want a shapefile table to be autofilled,for example each new point i place has an attribute column that auto fills its self a set of repeated numbers such as (1,2,3,4,1,2,3,4,1,...etc)

and another column to have a string and numbers and the numbers would increase
(a1a1,a1a2,a1a3,a1a4,a1a2,a2a2,...etc) and so on, and if one value gets deleted i can relace it without the entire data shifting

Is there a function for those things?


texts: GDAL PostgreSQL shapefile import "Unable to find driver 'PostgreSQL"

texts:
I have seen a number of posts similar to this but with no resolution.

I am experimenting with GDAL commands and am fairly new to it however when using a PostgreSQL database connection I am getting the following errors:

  FAILURE: Unable to open datasource `PG:host=127.0.0.1 port=5432
  dbname=postgres user=postgres password=*******' with the following
  drivers.
  (Lists all drivers)

or

  ERROR 1: Unable to find driver `PostgreSQL

ogr2ogr -overwrite -update -f PostgreSQL PG:"dbname='cadcorp' host='localhost' port='5432' user='postgres' password='********'" C:\Users\tommyh\Desktop\data\merged.shp -nlt POLYGON -nln gdaltestupload -progress

when I run gdalinfo --formats the list doesn't PostgreSQL so I guess I can see why the PostgreSQL connection isn't working compared to when I use a SQL Server connection MMSQLSpatial which is in the formats list.

I have set the environment variables:

GDAL_DATA=C:\Program Files\GDAL\gdal-data

GDAL_DRIVER_PATH=C:\Program Files\GDAL\gdalplugins

My GDAL version is:

gdalinfo --version
GDAL 2.2.3, released 2017/11/20

Running through the command prompt on Windows 10.

Any ideas on what I may be missing or need to do?


texts: Seeking "Official" delineation of North American mountain ranges?

texts:
I need to subset mosaics of remotely sourced data to the extents of several prominent North American mountain ranges, starting with the Sierra Nevada. After searching for the boundaries of the range it has become clear to me that this isn't quite as straightforward as I thought: wikipedia, peakbagger, the California DFG, the Sierra Nevada Conservancy and my desktop copy of google earth all show clearly different boundaries for the range. Clearly, the border a mountain range is less black and white than, say, an administrative boundary.

Are there "official" (by which I mean either authoratative or generally agreed-upon) definitions of the extents of North American mountain ranges, and if so, where can they be found?

Obviously it would be nice if it existed as a shapefile, but I can digitize it myself if it's just a list of bounding points.

To clarify, I don't particularly care if the boundaries are somewhat arbitrary/inaccurate from a strict geological perspective, as long as they come from an authoritative/trusted source. I'm not studying geological processes- I just need a reasonable citation.


texts: Clipping aerial photograph with LiDAR tiffs for sediment volume calculation?

texts:
I currently have an aerial photograph of a barrier beach, and corresponding LiDAR data for the 2005 photo, 2007 photo, and 2013 photo.

I want to calculate the volume of sediment on the beach for each year above sea level. There are various guides but I am still confused how to do this for just the area of beach I have, and not the whole area of LiDAR. The LiDAR files are tiff.

I am using ArcMap 10.2.2.


texts: QGIS not providing accurate grid lines on exported map

texts:
When I apply a grid to my map in the QGIS 'Layout Manager', the grid lines seem to begin from 0.00000 on the x/y axes, opposed to the accurate grid coords. As seen here in my exported map:

Here are my 'Map Grid Propeties' settings:


texts: Can QGIS report/calculate areas/perimeters of individual polygon components within multipart shapefile?

texts:
Can QGIS report/calculate the areas/perimeters of individual polygon components within a multipart shapefile without using the "explode" vector tool to generate a new file?

using QGIS 2.2.0 on Windows from OSGEO4W


texts: OL3 how to get WKT representation of a Polygon

texts:
I have a vector layer in OpenLayers 3 that I want to export to a shapefile, I take the geometry of the polygon. In an attempt to fix an issue with my WKT (see this question)  I add the first coordinate to end of the list of coordinates, but when exporting the file with these last coordinate the polygon is drawn with a line joining the last points of the polygons, there are any way to draw the polygon without these points, or another way to take the geometry without this issue?

An example of the polygon generated:

Here the example of the coordinates (to open in QGIS):

https://drive.google.com/file/d/0B6CZzmxH4VxrZi16eEM2ZmFKWmc/view?usp=sharing

I'm using this code:

Take the geometry:

     .....
    {
        var featureGeom = [];
        var arreglo = [];
        var arreglo2 = [];

        var controlador = aplicacion.getController("ControlResultados");
        var vectorSeleccion = controlador.buscarcapa('capaSeleccion').getSource().getFeatures();

        for (var x = 0; x < vectorSeleccion.length; x++) {
            featureGeom.push(vectorSeleccion[x].getGeometry().getCoordinates());
            for (var y = 0; y < featureGeom[x][0].length; y++) {
                arreglo.push(featureGeom[x][0][y]);
            }
        }

        for (var z = 0; z < arreglo.length; z++) {
            arreglo2.push(arreglo[z][0]+" "+arreglo[z][1]);
        }

        var nombreArchivo = "archivoSHPResultado";
        var parametros = {
                archivoPersistencia : nombreArchivo,
                geomPolygon : "POLYGON(("+arreglo2.toString()+"))",
                nombreArchivo: 'CapaSHPResultado'
        };
        this.descargaArchivoSHP(parametros);
    },
    descargaArchivoSHP: function(contenido){
        Ext.Ajax.request({
            url : "ServletShape",
            method : 'POST',
            params : contenido,
            success : function( respuesta ) {
                var rutaActual = location.href.split("//");
                var rutaActualPartes = rutaActual[1].split("/");
                var nuevaRuta = rutaActual[0] + "//" + rutaActualPartes[0] + "/" + rutaActualPartes[1] + "/" + respuesta.responseText;

                window.open(nuevaRuta);

                Ext.MessageBox.show({
                    title: 'WARN',
                    msg: 'OK',
                    buttonText: {
                        yes: 'OK',
                    }
                });
            },
            failure : function() {

                Ext.MessageBox.show({
                    title: 'WARN',
                    msg: 'FAIL',
                    buttonText: {
                        yes: 'OK',
                    }
                });
            }
        });
     }
    ......


texts:
I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings?

What is the easiest way to install GDAL/OGR if I only want to use it from Python?
I'm looking for an answer that applies to both mac and windows.

GDAL is listed in the Python Package Index (PyPi) but I don't understand how to install its dependencies (libgdal and the header files for both libgdal and numpy). Maybe all I need to do is install numpy and then get libgdal somewhere, and if so, where? Does a windows install need the Windows Binaries in addition to libgdal and it's header files?

How can I ensure that I get the proper python bindings for my version of Python (2.5, 2.6, 2.7, 3)?
Must changes be made to the PATH environment variable in order to use GDAL and OGR from Python, or can everything be accessed through my site-packages folder and a typical import statement?

These questions are relevant to this question but do not answer it:
installing GEOS, PROJ, GDAL/OGR into a python virtualenv on Mac OS X
How to install GDAL with Python on windows?

I should note that FWTools, OSGeo4W, and kyngchaos offer ogr and gdal with python bindings and are excellent, but FWTools and OSGeo4W ship with their own python, rather than acting as libraries for an existing python installation, and the kyng chaos frameworks appear to be for OS X only.


texts: Clockwise rotation bias in projection of shp

texts:
I am working on a land use/land cover map of Lebanon with QGIS. This shapefile has a .prj file, but apparently QGIS fails in recognizing the projection, as it results shifted northeastwards.

See below (purple, the correct location of Lebanon; sky blue, the LULC map as positioned by QGIS according to the .prj file)

Here's the .prj content

PROJCS["stereolev",GEOGCS["GCS_levant",DATUM["D_levant",SPHEROID["Clarke_1880_IGN",6378249.2,293.46602]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",39.15],PARAMETER["Scale_Factor",0.999534104],PARAMETER["Latitude_Of_Origin",34.2],UNIT["Meter",1.0]]

Also, the .prj is not associated to any EPSG already listed in the QGIS database.

According to epsg.io, in Lebanon three different EPSG are used

22700 Deir ez Zor / Levant Zone

22770 Deir ez Zor / Syria Lambert

22780 Deir ez Zor / Levant Stereographic

Changing the CRS to 22780 did not result in any change, while 22700 or 22770 apparently seemed to be the appropriate CRS. "Apparently", because some kind of bias emerged at closer inspection, some kind of clockwise rotation.

Is there a way to fix the issue (in QGIS or, even better, with R)? Any idea on what is all about?


texts: How do I make/edit a land sea mask in NetCDF format?

texts:
I have a land-sea mask.nc file where land=1 and sea=0. I want to mask this global LSM to my study area so that the study area=1, and rest=0. I have the study area shapefile and the LSM NC file.

How can I do this? I have been stuck at this step.


texts: Does QGIS Recognize Annotation Feature Classes from File Geodatabase?

texts:
My work has recently set up QGIS to access an Esri file geodatabase on a shared drive for my co-workers.

I have not used QGIS much, but I have encountered an issue where the annotation feature classes are displayed as a polygon instead of text. The geometry type of all the annotations are shown as 'MultiPolygon' when a vector layer from the geodatabase is added to QGIS.
When the annotations are added to ArcMap, they appear as they are meant to - as text.

Am I doing something wrong?


texts: QGIS Quickly switching overlapping raster images

texts:
I'm new to QGIS, and haven't used arcGIS in about 5 years, however I've just seen someone using arcGIS and was able to quickly switch between overlapping rasters when checking registration. The top half of the screen was one raster, and the bottom was another, and the mouse was used to move up and down in real time switching between the two (I'm probably not explaining this very well).

The images I'm working with are very large (2x1GB geotiffs) and of the same area. There is a good 5second lag between switching layers which makes it difficult to see if there is good alignment.

Does this functionality exist in QGIS, to quickly switch rasters in real time?


texts:
I'm designing a QGIS plugin where I'd like to offer the user the functionality to select the extent of a bounding box from the canvas like in some tools like Create grid.

I've explored QT Designer but there is no widget with this functionality.

I have also explored the tool code of tools that offer this functionality but found nothing.

Finally, I didn't find any documentation about this feature. Any ideas?


texts: QGIS: Connect two nodes with line to close segment?

texts: I have a line that I drew where the ends are not connected. I now want to select the two end nodes and hit a button to have QGIS connect them with a line segment. How do I do this?


texts:
I am trying to learn more about the new ArcGIS Server Search that comes with ArcGIS 10.

Does anyone know where I can find detailed instructions on how to implement and use this feature?  Specifically, how to build the seach index?

Thanks,
Seth


texts:
I am trying to install QGIS 2.16 (Nodebo) on my Ubuntu 16.04 LTS but as soon as I start the application I get the following error:

Couldn't load PyQGIS.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in
ImportError: No module named qgis.core

Python version:
2.7.12 (default, Jul  1 2016, 15:12:24)
[GCC 5.4.0 20160609]

QGIS version:
2.16.2 'Nødebo', 979e1a2

Python path:
['/usr/share/qgis/python', u'/home/matt/.qgis2/python', u'/home/matt/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/share/qgis/python', '/home/matt/anaconda2/lib/python2.7', '/home/matt/anaconda2/lib/python2.7/plat-x86_64-linux-gnu', '/home/matt/anaconda2/lib/python2.7/lib-tk', '/home/matt/anaconda2/lib/python2.7/lib-old', '/home/matt/anaconda2/lib/python2.7/lib-dynload', '/home/matt/anaconda2/lib/python2.7/site-packages', '/home/matt/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.1-py2.7.egg', '/home/matt/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg']

I've already tried to set the PYTHONPATH variable (to /usr/share/qgis/python) and the LD_LIBRARY_PATH (to /usr/lib/ -> this is where libqgis_core.so.2.16.2 is located. Is this path wrong?)

maybe my anaconda2 makes the trouble but how to solve that?


texts: Calculating a single number fra an array in field calculator using other fields

texts:
For my final project, I would like to assess the earthquake risk of populated areas in California. For this I have two multipolygon layers containing data for Earthquakes, and populated areas respectively - named Earthquakes and CA_pop.
For each earthquake, a buffer zone describing its area of effect has been calculated.
In the field calculator for the CA_pop layer, I am trying to calculate a risk, which is determined by the number of historical earthquakes hitting the populated area. For each earthquake, I would like to take its magnitude (a field in the Earthquake layer) and multiply it by the population density of the area, then sum all of this up.
So far I have managed to find the number of Earthquakes intersecting with each populated area, and from these get the magnitude of the earthquakes in an array by doing the following: overlay_intersects(layer:='Earthquake', expression:=attribute("mag"))
A preview of this could look like:

Essentially, for this particular preview, I would like to do the following:
10^(6.7)*pop_dens + 10^(7.5)*pop_dens + 10^(7.93)*pop_dens + 10^(7.5)*pop_dens to the power of, due to it being the Richter scale, and where the pop_dens is the population density of the given feature.
From here, I have however now been stuck for a while, and nothing I have tried seems to work. I feel like it is quite straight forward, but my inexperience in QGIS makes it a bit challenging.


texts:
Is there a QGIS function or plugin to draw wiggly line?

I have used Spline Tool to manually draw some waves, but it is time consuming.
If possible, I would like to draw something like:

Inkscape Function Plotter ( sin(x) curve).


texts:
I have a POI table with some data of categories like Airport,ATM,Bank etc. I want to show these categories as checkbox so that if I click in the ATM Checkbox, only the ATM Points will be display. Is there any option in Geoserver?

Regards,
Sreesha


texts: How do I reduce contour intervals (i.e. from 50m contours to 10m contours) without using DEM?

texts: I have shapefiles (lines) of contours having 50m intervals. How can I reduce the intervals to 10m without first converting the 50m contours to DEM?


texts:
I've built the following heatmap using QGis 2.8.2's Raster->Interpolation feature. It looks almost the way I want:

The background layer is Google Maps tiles by using the OpenLayers plugin.

However, as you may see, the outer edges abruptly end, since it's basically a rectangle. I would to produce an output that would not crop the edges like this and would give a more organic output, following the outer points, like the following:

Does anyone know how could I accomplish this with QGis and or related tools?


texts: Showing raster map pixel's information(pixel value) when clicked on the map in OpenLayers?

texts:
Here is my raster map code and I want see pixel information like pixel value from it when I click on the map:
const UnTiled = new ol.layer.Image({
    opacity:0.9,
    source: new ol.source.ImageWMS({
        ratio: 1,
        url: 'http://localhost:8080/geoserver/shomal/wms',
        params: {
                 'VERSION': '1.1.1',
              "STYLES": '',
              "LAYERS": 'shomal:geotiff_coverage',
              "exceptions": 'application/vnd.ogc.se_inimage',
        }
      })

    });map.addLayer(UnTiled);


texts: OpenLayers SelectFeature - Manually set feature as selected/unselected

texts:
In the OpenLayers SelectFeature, how can I manually set a feature as selected/unselected and have it reflect the appropriate color?

For instance, when my application loads, it sends back the existing select state which I want to set on the polygons. Thanks!


texts: Why do gdal_translate and python gdal give wrong result (output spatial location) for translation of netcdf4 to geotiff?

texts:
I try to convert netcdf4 file to raster by using gdal and python.
The netcdf4 file is in the WGS84 geographic coordinate system.
When I use "Make NetCDF Raster Layer" in ArcMap, the netcdf file is converted to raster and placed on the right spatial location.

However,when I use the commandline gdal_translate as below, the translated raster is placed on the wrong spatial location.

'gdal_translate -of Gtiff -a_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" NETCDF:"precip.nc4":precipitationCal "RasterPrecip.tiff"'

I get same result for gdal python as shown below also. The converted raster is placed on wrong spatial location

from osgeo import gdal
filename = "precip.nc4"
data = gdal.Open('NETCDF:"'+filename+'":precipitationCal')
Dataset = driver.Create(Newfile, xsize, ysize)
Dataset.SetGeoTransform(geo_transform)
Dataset.SetProjection(spatialRefProj)
Dataset.GetRasterBand(1).WriteArray(rain)

I am unable to get the projection from the file.
data.GetProjection() gives invalid (' ') projection.
As the file coordiante system is as WGS84, I used.

spatialRef = osr.SpatialReference()
spatialRef.ImportFromEPSG(4326)

Further, data.GetGeoTransform() gives
(57.4, 0.1, 0.0, 14.8, 0.0, -0.1).
The first value should be top lext, x (longitude). Here comes latitude value(57.4). I expected to get (6.4,0.1,0,62.0,0,-0.1). However, if I set this as geotransform, I still get wrong result.

I think that wrong geotransform which is read from the netcdf file may be the reason for wrong result but how is ArcMap reading correctly?

Additional information:
By commandline gdalinfo NETCDF:"precip.nc4":precipitationCal gives

Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files:C:\precip.nc4
Size is 46, 84
Coordinate System is ''
Origin = (57.400000762939456,14.800000001149005)
Pixel Size = (0.100000000000000,-0.100000002298010)
Geolocation:
  LINE_OFFSET=0
  LINE_STEP=1
  PIXEL_OFFSET=0
  PIXEL_STEP=1
  SRS=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
AUTHORITY["EPSG","4326"]]
  X_BAND=1
  X_DATASET=NETCDF:"C:\precip.nc4":lon
  Y_BAND=1
  Y_DATASET=NETCDF:"C:\precip.nc4":lat
Corner Coordinates:
Upper Left  (  57.4000008,  14.8000000)
Lower Left  (  57.4000008,   6.3999998)
Upper Right (  62.0000008,  14.8000000)
Lower Right (  62.0000008,   6.3999998)
Center      (  59.7000008,  10.5999999)


texts:
I have found some examples but haven't managed yet to adapt them to my needs...

I have an image that is served as TMS (tiles already statically rendered): http://humadat.alwaysdata.net/tms/khorog/tiles

What would be the right syntax to display it in OpenLayers?

On this example: http://openlayers.org/dev/examples/tms.html It looks quite different, as if the tiles are dynamically rendered by a python script...

I tried something like this

layer = new OpenLayers.Layer.TMS( "TMS",
    "http://humadat.alwaysdata.net/tms/khorog/", {layername: 'tiles', type:'jpg'}
);

But no success so far


texts: Update existing Postgres table from KML?

texts:
This is related to this question, but different because it's about PostGis, not Django.

I'm using Postgres 9.4 with PostGIS extensions. I have a KML file, and I want to use it to update the geographic field of an existing table. This is my table:

               Table "public.frontend_pct"
      Column       │          Type           │ Modifiers
───────────────────┼─────────────────────────┼───────────
 code              │ character varying(3)    │ not null
 name              │ character varying(200)  │
 boundary          │ geometry(Geometry,4326) │
 org_type          │ character varying(9)    │ not null
 managing_group_id │ character varying(3)    │
 address           │ character varying(400)  │
 close_date        │ date                    │
 open_date         │ date                    │
 postcode          │ character varying(10)   │

Is it possible to use ogr2ogr (or any other utility) to update my existing table's boundary field, but leave everything else intact?

My KML file has boundary and ID fields. I would like to join the ID field in the KML with the code field in the file. I can edit the names of these fields if needed.

ogr2ogr does seem to have an update option. I've been trying this:

gr2ogr -update -nln frontend_pct -f PostgreSQL PG:"host=127.0.0.1 dbname='$DB_NAME' user='$DB_USER' password='$DB_NAME'" myfile.KML

But I get this error:

FAILED: Layer frontend_pct already exists, and -append not specified.
        Consider using -append, or -overwrite.
ERROR 1: Terminating translation prematurely after failed
translation of layer Layer #0 (use -skipfailures to skip errors)

Firstly, how do I update an existing table? Secondly, how do I specify the fields to join on, or do I just need to rename my KML fields?


texts:
I don't understand why my code doesn't work. If the map is displayed, the line is never drawn:

<script>
var long_deb = -1.28627;
var lat_deb = 43.49829;
var long_fin = -1.29394;
var lat_fin = 43.49858;
var attribution = new ol.control.Attribution({
  collapsible: false
});

var map = new ol.Map({
  controls: ol.control.defaults({ attribution: false }).extend([attribution]),
  target: 'map',
  view: new ol.View({
    center: ol.proj.fromLonLat([long_deb, lat_deb]),
    zoom: 15
  })
});
var layer = new ol.layer.Tile({
  source: new ol.source.OSM()
});
map.addLayer(layer);
var linestring = new ol.geom.LineString([[long_deb, lat_deb], [long_fin, lat_fin]], 'XY');
var lineString_feature = new ol.Feature ( {
    geometry: linestring
});
var layerLine = new ol.layer.Vector({
  source: new ol.source.Vector( {
    features: [ lineString_feature]
  })
});
map.addLayer(layerLine);
console.log(
    "lineString coordinates", linestring.getCoordinates(),
    "extent", linestring.getExtent(),
    "layout", linestring.getLayout());

var longueur =linestring.getLength();
console.log("longueur", longueur);
</script>

and the console message (log) :

lineString coordinates Array [ Array[2], Array[2] ] extent Array [ -1.29394, 43.49829, -1.28627, 43.49858 ] layout XY
longueur 0.007675480440988747

Any idea?


texts: Earth engine: first() function on featureCollection does not extract a Feature?

texts:
I am trying to extract an element from a featureCollection, and apply the area() function to it. The output from *.first() looks exactly like a Feature, but yet, when I apply area(), I get:

  fromListFirst.area is not a function

I actually need to re-assign it the ee.Feature function to work. Likewise, if I were to extract the geometry from the feature, I will obtain something that looks much like a standard polygon, yet area() will refuse to work?

Question: what is happening exactly? Why does my object really look like a Feature, yet the area function does not work on it? It looks like a magic attribute is disappearing at some point?

var R1 = ee.Feature(ee.Geometry.Rectangle(30.01, 59.80, 30.59, 60.15),
 {name: 'Voronoi'});

// Create a FeatureCollection with R1
var fromList = ee.FeatureCollection([R1,R1]);

// Extract first element with first():
var fromListFirst = fromList.first();

// reassign it the feature class:
var fromListFirstFeat = ee.Feature(fromListFirst);

// the original feature, the one obtained with first,
//and the one with first then feaure appear to be exactly the same:
print('R1', R1)
print('fromListFirst', fromListFirst)
print('fromListFirstFeat', fromListFirstFeat)

// But last one won't work
var areaR1 = R1.area();
var areaFirstFeat = fromListFirstFeat.area();
var areaFirst = fromListFirst.area();

//extract geometry:
var aa = fromListFirstFeat.getInfo().geometry;
var areaAA = aa.area();


texts: Getting around current database field limitations?

texts:
I have a need to store over 350 fields in a table and have this information readily available to display spatially. The problem is that access only allows for 255 fields. So the feature class that I am wanting to store all of this information does not have the ability to hold all of those fields..

Can you help me think of ways around this limit?

The only solution I can think of is to store all of my information in a big, long csv and then call out the information that I want at that time in a join.

The office that I am at is behind on the times and is still heavily using Access to query and store our data. We are WELL AWARE of the limitations and are on our way sometime in the next year to hopefully go to ArcGIS for Server and SQL server.


texts: Grid and Graticule in QGIS Print Composer in QGIS 2.8

texts:
I'd like to add a grid in the print composer. The problem is there is no visible option like it was in previous version. I mean I'm looking for an option "Show grid?" like in the picture below. I can't see this in 2.8.

How do I do it?


texts: Erasing overlay geometry with in the feature class..!

texts:
What is the best practice for erasing overlay geometry? My scenario is: I have a polygon layer with 1000 features. i need to create a tool from model builder that select polygons with user defined attributes, and verify if there is any other polygons are overlapping. Then erase the overlay area from overlay polygons.

EX: Polygon A is selected by attributes and polygon B is overlapping with A. Erase overlapping area from B.

I am able to find the overlapping polygons, but when i use Erase tool it is creating new feature class but i need output should be modified with in the same feature class. This is nothing but Clip in Edit toolbar with "Discard the area that intersects".


texts: The image collection doesn't correspond to my interactive map (Sentinel-1 in Google Earth Engine)

texts:
I want to classify water pixels with Sentinel-1 in Google Earth Engine, and I'm using this code I found here: https://mbonnema.github.io/GoogleEarthEngine/07-SAR-Water-Classification/

However, in my case, I observed that the image collection that I print, and the dates on my interactive map, are not the same. Why does this happen?

For example, in my collection the first two images are on 2 and 9-11-2017, and in the graph the date of 3-11-2017, also appears.

var vuursteentocht = ee.Geometry.Polygon([[[5.532513953154625,52.52616495848131],
[5.502301550810875,52.45759977830388], [5.581952429717125,52.44588284288133],
[5.617657996123375,52.51613770643291] , [5.532513953154625,52.52616495848131]]]);

Map.addLayer(vuursteentocht, {}, 'ROI')
Map.centerObject(vuursteentocht, 8)

var collectionVV_desc = ee.ImageCollection('COPERNICUS/S1_GRD')
 .filter(ee.Filter.eq('instrumentMode', 'IW'))
 .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
 .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
 .filterBounds(vuursteentocht)
 .filterDate("2017-10-30", "2018-02-21")
print(collectionVV_desc);
var classifyWater = function(image) {
var vv = image.select('VV')
var water = vv.lt(-12).rename('Water')  //keep water pixels below that threshold
water = water.updateMask(water)
return image.addBands(water)  //Return image with added classified water band
}

//Map classification across sentinel-1 collection and print to console to inspect
collectionVV_desc = collectionVV_desc.map(classifyWater)
print(collectionVV_desc)

 //Make time series of water pixels within region
var ClassChart = ui.Chart.image.series({ //
imageCollection: collectionVV_desc.select('Water'),
region: vuursteentocht,
reducer: ee.Reducer.sum(), //sum of water pixels
scale: 10,
})
.setOptions({
  title: 'Water Pixels',
  hAxis: {'title': 'Date'},
  vAxis: {'title': 'Number of Water Pixels'},
  lineWidth: 2
})

 //Set the postion of the chart and add it to the map
ClassChart.style().set({
position: 'bottom-right',
width: '500px',
height: '300px'
});

Map.add(ClassChart)

  // Create a label on the map.
var label = ui.Label('Click a point on the chart to show the image for that date.');
Map.add(label);

//Create callback function that adds image to the map corresponding with clicked data point on //chart
ClassChart.onClick(function(xValue, yValue, seriesName) {
if (!xValue) return;  // Selection was cleared.

 // Show the image for the clicked date.
var equalDate = ee.Filter.equals('system:time_start', xValue);
 //Find image coresponding with clicked data and clip water classification to roi
var classification =
ee.Image(collectionVV_desc.filter(equalDate).first()).clip(vuursteentocht).select('Water');
var SARimage = ee.Image(collectionVV_desc.filter(equalDate).first());
//Make map layer based on SAR image, reset the map layers, and add this new layer
var S1Layer = ui.Map.Layer(SARimage, {
  bands: ['VV'],
  max: 0,
  min: -20
});
Map.layers().reset([S1Layer]);
var visParams = {
  min: 0,
  max: 1,
  palette: ['#FFFFFF','#0000FF']
}
//Add water classification on top of SAR image
Map.addLayer(classification,visParams,'Water')

// Show a label with the date on the map.
label.setValue((new Date(xValue)).toUTCString());
});


texts: How to generate an image from OSM on command line?

texts: Is there a GNU/Linux command line tool that allows to generate an image file from OSM, preferably as an SVG?


texts: What parts of ArcGIS 9.3 Geoprocessor Programming Model diagram are not relevant for ArcGIS 10?

texts:
The geoprocessor programming model was an excellent tool for python scripting using ArcGIS 9.3. There is still no equivalent diagram for ArcGIS 10 - although there is a request on the ArcGIS ideas site.

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy? asked if the 9.3 diagram is good to use for ArcGIS 10. The answer was that some of it is relevant and it is best not to use it. However, I really like the diagram and would like to reference it when scripting ArcGIS 10. Therefore my specific question is:

What parts of the ArcGIS 9.3 diagram are not relevant to ArcGIS 10? Correct me if I'm wrong, but from what I understand, if an equivalent diagram was made for ArcGIS 10, there would be new functions added to the diagram; the diagram would only get bigger.


texts: How to integrate some Python code in "PythonCaller" FME?

texts:
Following lines of Python code joins some fields of attributes in single attribute field. It works just fine in ArcGIS but it would be even better if that would work also within FME PythonCaller.
In ArcGIS looks like this:
def merge_fields(*fields):
    return ','.join([f.strip() for f in fields if f.strip()])

in the Field that I want it to be merged, I write:
merge_fields(!FIELD_1!, !FIELD_2!, !FIELD_3!, !FIELD_4!)

The question is how these 3 lines of code could be integrated within PythonCaller.
when I open PythonCaller looks like this:

example of my data: First 4 columns is what i have and column 5 is what i need.


texts: srtm30 image: some are grayscale some are black & white

texts:
I downloaded these DEM files, http://www.dgadv.com/srtm30/
srtm30 globe. I open the DEM files in Multispec. Some of them are black and white, some are automatically grayscale.

How do I get them all in grayscale?

(attaching image to explain)


texts: Error while executing v.rast.stats command in grass plugin in qgis

texts:
I have a vector polygon which I imported in grass. I also have a raster from which I have to extract the value. I ran v.rast.stats command in QGIS 2.12. The command was executed with error. The error reads:

DBMI-DBF driver error: ￼Error while executing: 'BEGIN TRANSACTION' Finished with error

Don't know what to do? Tried searching for this in gis stack exchange but it talks about scripts which I don't use.


texts: Running a succession of spatial analyst tools

texts:
I am writing a very simple code in ArcMap. but it does not run correctly. I want to put a majority filter on my input raster, then use fill tool and then subtract the filled one from the last one and then reclassify the result. the problem is that when I run the code line by line, It works but when I want to run all the code together, I see a bug before "Fill" line. anybody knows what is the problem?

import arcpy

from arcpy import env

env.workspace = r'C:\Users\Arsalan\Documents\ArcGIS'

import arcpy.sa

from arcpy.sa import *

MajorityFilter("Meet_Raster", "EIGHT", "MAJORITY")

MajorityFilter("Meet_Raster", "EIGHT", "MAJORITY")

MajOut = MajorityFilter("Meet_Raster", "EIGHT", "MAJORITY")

arcpy.CheckOutExtension("Spatial")

Fill("MajOut", 12)

FillOut = Fill("MajOut", 12)

RastCalc = Raster("FillOut") - Raster("MajOut")

RastReclass = Reclassify("RastCalc", "Value", RemapRange([[0,0,"NODATA"],[1,3,1],[4,9,2],[9,15,3]]))


texts: QGIS ODBC connection to mssqlserver returns only filtered data

texts:
I am connecting to an MSSQL database table which does not have a geometry type field, but has coordinates in separate columns. The ODBC connection works, but when I bring the table in to QGIS, it is filtered, with no way to unfilter it, so I only see one row in the attribute table.
Has anyone seen this and know how to see all features?
I have tried other tables from databases with the same schema and most show up fine, but occasionally others have the same issue.


texts: GeoWebCache Truncate - Ignore Env Parameters

texts:
Does anyone know if it's possible to truncate a GeoServer/GeoWebCache layer by viewparameter but ignore any env parameters?

We want to be able to truncate all tiles generated with viewparam=WhateverParamer:1 regardless of the env parameters supplied when the tile was requested/generated.

For example; We may have a layer that has a single viewparam but 2 env parameters. When we go to truncate, we don't want to remove all the layer tiles (e.g. can't be done with /masstruncate) but only the tiles generated with viewparam=WhateverParamer:1. This means we have to send a truncate request for every possible combination of those 2 env parameters * the available values for those env parameters. If the env parameter can have a large number of possible values, this can lead to having to send a huge number of requests to truncate the layer.

We've tried a few different things to get this to work:

Send the truncate request supplying the viewparam but without the env param - This truncates nothing because all tiles were generated with at least one env param

<?xml version="1.0" encoding="UTF-8"?>
<seedRequest>
   <name>layer_name</name>
   <type>truncate</type>
   <gridSetId>EPSG:900913</gridSetId>
   <zoomStart>0</zoomStart>
   <zoomStop>30</zoomStop>
   <format>image/png</format>
   <threadCount>16</threadCount>
    <parameters>
        <entry>
          <string>viewparams</string>
          <string>WhateverParamer:1</string>
           </entry>
  </parameters>
</seedRequest>

Use the masstruncate endpoint and attempt to supply the viewparams - This truncates nothing because I don't believe this is what this was intended for (I think this has to do with orphaned parameter filter tiles)

<truncateParameters>
    <layerName>layer_name</layerName>
    <parameters>
    <entry>
           <string>viewparams</string>
           <string>WhateverParamer:1</string>
      </entry>
  </parameters>
</truncateParameters>

Even supplying the env entry but leaving it blank, using a wildcard, regex...just about everything we could think of. - Still truncates nothing without explicitly supplying the env param the tile was generated with.
Each of these combinations using both XML and form-encoded request.

Does anyone have any suggestions on how we can accomplish this without sending a huge number of requests?

UPDATE

It looks like this has come up before on the Geoserver User Mailing List and looking through the Github issues/PRs it appears that there have been merged PRs dealing with this #360 & #359...however I haven't been able to glean if or how this helps solve this issue...nor how I might modify the truncate request to take advantage of these changes.


texts:
I want to use geojson data in google map application like this (enter link description here).

The geojson data (see link enter link description here) is what I am looking for.

Do I need a (online) database server to run it?

Does mySQL or PostgreSQL work?

I know I can add geojson data (text) directly to the code, but it make the loading slow. Somebody mentioned MongoDB could handle geojson data, but I never used it.


texts: What dissolve tool in QGIS allows me to summarize statistics for multiple attributes?

texts:
Is there a tool or plugin in QGIS that resembles ArcGIS 10's Dissolve tool? I'm trying to dissolve several polygons (parks) around the boundaries of another layer of polygons (cities), while performing various calculations for multiple attribute fields (like summing their total area, doing a count of features, etc).

I looked into an earlier question (Batch Dissolve Polygons based on Attributes in QGIS or FWTools) where ftools was recommended, but ftools doesn't allow you to specify the way you would like to summarize statistics for multiple attribute fields. Is there one tool that allows me to summarize statistics for multiple attributes, like the ArcGIS Dissolve tool?


texts: Listing data sources in ArcGIS map (*.mxd) without opening it?

texts:
Is there any routine I can use to read the data sources out of mxd´s without waiting 30 seconds to open each one?

I need to create lists of all data sources as we are migrating data and altering our file system.

I have around 1000 mxds which need to be checked.


texts:
I have the following code but the output is empty. It is very slow. I want a pair to pair pgr_dijstracost rather than many to many. Is there a feasible solution?
DO
$do$
DECLARE
   ii int := 1;
BEGIN
   WHILE ii < 1396381
   LOOP
     INSERT INTO public.loop (start_vid,end_vid,agg_cost)
     Select * from pgr_dijkstraCost(
    'select gid as id, source, target, length as cost from table1'
    ,(select table1.source from table1 Inner join table2 on table2.segment = table1.segment where table2.id = ii)
    ,(select table1.target from table1Inner join table2 on table2.segment2= table1.segment where table2.id = ii)
    ,false);
    ii := ii + 1;
   END LOOP;
END
$do$


texts:
I am trying to control the time slider object through my code in the python console. As given in couple of examples, the time property of a data frame could be controlled by Data frame time property. Assuming I have a time aware layer on my current document. I just want to control the time slider by specifying the startTime and End time. I had used the below code to change the data frame time.

mxd= arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd,"*")[0]
df.time.startTime= datetime.datetime.strptime('14-JUL-2010 07:45:00','%d-%b-%Y %H:%M:%S')
df.time.endTime=datetime.datetime.strptime('14-JUL-2010 08:45:00','%d-%b-%Y %H:%M:%S')

But the time slider is still showing the intial time Extent of the layer. Is there a way to atleast restrict the layer below with the time property so that i could display only from one time to other time? Typically I have to get user input and run the time slider from that point the user specifies. Please let me know if it is possible in arcpy


texts: Postgresql Trigger to insert records in my table from another one

texts:
I spent few days trying to resolve this question but it was impossible.

I have two tables:

Table1.

CREATE TABLE point
(
  id_point integer NOT NULL DEFAULT,
  layer text,
  elevation numeric,
  geom geometry(POINT,25830)
)

Table2.

CREATE TABLE point2
(
id_point2 integer NOT NULL DEFAULT,
layer text,
elevation numeric,
geom geometry (POINTZ, 25830)
)

In this situation I want get the values from point.elevation,point.geom and insert to point2.elevation, point2.geom each time I insert a new row in point table.

Also to say I need transform the point.geom value before to insert into point2.geom like this:

geom=st_setsrid((st_makepoint(st_x(point.geom),st_y(point.geom),point.elevation)), 25830)

I tried to create this trigger but I did not get the expected result, my trigger inserted all my records from point to point2, but I need do it for each new record from point table:

The function:

CREATE OR REPLACE FUNCTION function_prueba() RETURNS TRIGGER AS $$
DECLARE
BEGIN
    INSERT INTO
        point2(elevation,geom)
        VALUES
            NEW.point.elevation,
            st_setsrid
                (
                    (
                           st_makepoint(st_x(NEW.point.geom),st_y(NEW.point.geom),NEW.point.elevation)
                    ), 25830
                )
                FROM
                         point
                ;
    RETURN new;
END;
$$ language plpgsql;

The trigger:

CREATE TRIGGER trig_geotrans
     AFTER INSERT ON point
     FOR EACH ROW
     EXECUTE PROCEDURE function_prueba();

How can I resolve this question?
Thanks.