Tag Info

New answers tagged

0

in sql you can write something like this : SELECT * FROM x where pipedn >= 5 AND pipedn <= 10 or SELECT * FROM table x WHERE pipedn BETWEEN 5 AND 10 these examples show howto use WHERE if all your tables are same you can do: SELECT col1, col2 from x UNION ALL SELECT col1 , col2 from table y this one select two table x and y and creates ...


2

Do you mean errors using the Editor?? Otherwise, if you are using for example CartoDB.js, you could check and debug the requests made by browser. For example, with Google Chrome, you could open Google Dev Tools and look at Network tab. There, you could check the errors request (red). And there, you can find the error returned by the database.


1

Yes, sort of. You can't send arbitrary SQL to GeoServer, but you can use a subset of SQL with the CQL_FILTER parameter. http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html With CQL you can do filtering including intersects and attribute filtering. For more complicated queries you might have to write a custom WPS process.


0

A lot of VBscript functions work in SQL.. for example CDbl but such commands are for the more modern databases like Microsoft Jet (Access format), Esri fGDB and enterprise databases like Oracle, SQL Server and PostgreSQL. Shapefiles rely on long outdated DBase IV commands which can be really difficult to get help on. This is because queries are passed on to ...


1

The answer to your question depends on the database you are working with. For File Geodatabase feature classes and tables you can use the Cast operator. For example, this will work in a File Geodatabase: Service_Day <> CAST(Region AS FLOAT) You can also convert a numeric value to a string and compare it: CAST(Service_Day AS VARCHAR(1)) <> ...


1

Yes, you can do it with CartoDB.js. This link will help you: http://bl.ocks.org/xavijam/378c6dc0d43654280757


2

If you want to have different visualisations but only modifying your query params, for instance because a filter changed and you want to change your where from WHERE somefield = 'x' to WHERE somefield = 'y', probably you want to have a look at the named maps + templates functionality provided by the Maps API. That allows you to create visualisations without ...


1

If you want to clear the querys, you need to click on the option "clear view" in the green bar that appears in the data view: See image attachment: About your second question (adding/deleting fields from tables), you need to click on the option "Add column". It is at the right menu (in Data View), the last option. I attach an image too:


0

You could probably use PostgreSQL aggregate functions to solve this. Assuming your columns are strings, you could just use string_agg(expression, delimiter) on the query in order to retrieve several columns in just one row.


1

(Credit to @Russell at ISC for the use of the modulo operator.) We have a table in SQL Server with a column of geography data type, called [GeoCoor]. This is how we convert to degrees, minutes, and seconds: SELECT [GeoCoor].[Lat] as [DecimalLatitude], floor(ABS([GeoCoor].[Lat]))*(CASE WHEN [GeoCoor].[Lat] < 0 then -1 ELSE 1 END) as [LatDegrees], ...


0

Try using brackets around Lat and Long: select [geom].[Lat] as [Latitude], [geom].[Long] as [Longitude] from dbo.special


1

As per @FelixIP's answer, use an IN operator in your where clause. The multivalue parameter is passed as a single semicolon delimted string, i.e. "value1;value2;value3". To convert this to the required format for the IN operator use python split/list comprehension/join or replacement. split/list comprehension/join: fields = arcpy.GetParameterAsText(0) ...


2

Use DPD IN ('Gas','Oil','') instead of multiple OR


1

I use squel.js to create SQL queries in javascript. It's pretty straightforward + lightweight to boot: http://hiddentao.github.io/squel/


0

In most real-world datasets, the specific variation you describe is just the tip of an iceberg. You will typically uncover all manner of variations that will eventually defeat any exact match or scripted code/regex solution. Therefore I would use a Fuzzy Lookup algorithmn for this requirement. If the data volume is small and the task is a "one off", I ...


2

In QGIS you could try to sanitize your column with spaced characters by using regexp_replace( 'Some street 12 A', '\\s([0-9]+)\\s\w', ' \\1') via Field calculator. You will have to replace 'Some street 12 A' with your column: it should be working. Hope this helps.


2

In SQL, assuming your database supports regular expressions, you could do something like the following (postGres example). Something similar in oracle should also work. T-SQL is a bit more tricky as it doesn't have regular expressions. UPDATE someTable SET someCol = regexp_replace(someCol,'(\m[0-9]+)\M[ ]+\m([a-z]+)\M','\1\2','gi') WHERE someCol ~* ...


0

How can the below be replaced to use a variable in place of hard code values filter.WhereClause = featureClass.OIDFieldName + " IN (1,2,3,4,5,6)"; string strFIDS="1,2,3,4,5,6"; Does the below work ? filter.WhereClause = featureClass.OIDFieldName + " IN (strFIDS)";


1

You could try with a replace in Python, removing all [0...9] followed with a space. def RemoveWhiteAfterNumber(addressField): a = addressField for i in range(10): a = a.replace( str(i) +" ", str(i)) return a RemoveWhiteAfterNumber(!addressField!)


1

Does every address end in the form '12 A' or '12A'? If so, you could split on whitespace (the default, in python anyway), then test the last element to see whether it contains digits or not. Combine the last two elements if the last element is a plain alpha character. This could also work testing the last element for length, provided the last element of an ...


0

It seems I have found a good performing SQL SELECT k.rs, k.gen, (ck.incoming-sums.incoming) AS incoming, (ck.outgoing-sums.outgoing) AS outgoing, (ck.within-sums.within) AS within, ST_AsEWKB(ST_Difference(k.geom, geo.geom)) AS geom_b FROM de_commuter_kreise ck INNER JOIN ( ...


1

Just as a reminder: also make sure the classes or tables are part of the same geodatabase AND make sure the keyfields on which the join will be operated are of the same type.



Top 50 recent answers are included