2. Please Note:
• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.
• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in
making a purchasing decision.
• The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any
material, code or functionality. Information about potential future products may not be incorporated into any contract.
• The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM benchmarks in a
controlled environment. The actual throughput or performance that any user will experience will vary
depending upon many factors, including considerations such as the amount of multiprogramming in the
user’s job stream, the I/O configuration, the storage configuration, and the workload processed.
Therefore, no assurance can be given that an individual user will achieve results similar to those stated
here.
2
10. GeoSpatial Analytics In dashDB
• Implements OGC SFS & ISO SQL/MM part 3 standards for spatial
See http://www.iso.org/iso/catalogue_detail.htm?csnumber=38651
• Spatial data type ST_GEOMETRY (hierarchy)
• Enables spatial operations (e.g. joins) in database through spatial
operators available as user defined functions
• Dedicated support in ESRI tools starting V 10.3
• dashDB - R support through extension to ibmdbR package
11. Spatial Functions and Predicates in dashDB
SELECT a.name, a.type
FROM highways a, floodzones b
WHERE ST_Intersects(a.location,b.location) = 1
AND b.last_flood > 1950
SELECT a.road_id, a.time, i.id,
ST_Distance(a.loc, i.loc,’METER’) as distance
FROM accidents a, intersections i
WHERE ST_Distance(a.loc,i.loc,’METER’) < 10000
AND a.weather = ‘RAIN’
- accidents near intersections
- highways in flood zones
ST_Distance(g1,g2)
?
ST_Intersects(g1,g2)
?
12. Spatial Constructor Functions
ST_Point(x, y, srs_id) – create point at this location
ST_Point(‘POINT (-121.5, 37.2)’, 1)
ST_Linestring(‘LINESTRING (-121.5 37.2,-121.7 37.1)’,1)
ST_Polygon(CAST (? AS CLOB(1M)),1)
– For host variable containing well-known text, well-known binary, or shape
representation
14. Spatial Functions that Create New Spatial Values
ST_Buffer(geom, distance)
ST_Centroid(geom)
ST_Intersection(geom1, geom2)
ST_Union(geom1, geom2)
15. Functions that Return Information About a Spatial Value
ST_Area(geom), ST_Length(geom)
ST_MinX(geom, ST_MinY(geom), ST_MaxX(geom), ST_MaxY(geom)
ST_IsMeasured(geom)
ST_X(geom), ST_Y(geom)
ST_AsText(geom)
17. Harness the Full Power of SQL
Outer join
Common table expressions
Recursive queries, sub-queries
Aggregate functions
Order by, group by, having clauses
OLAP, XML, and more ...
WITH sdStores AS (SELECT * FROM stores
WHERE st_within(location, :sandiego) = 1)
SELECT s.id, s.name, AVG(h.income) FROM houseHolds h, sdStores s
WHERE st_intersects(s.zone, h.location) = 1
GROUP BY s.id, s.name
ORDER BY s.name
Example problem: Determine the average household income for the sales zone of each store in theExample problem: Determine the average household income for the sales zone of each store in the
San Diego area.San Diego area.
20. dashDB: Key Use Cases
• Minimize capital expense of DR solutionDR in the Cloud
21. We Bring Netezza Compatible Analytic Platform to the
Cloud
Analytic Extension FrameworkAnalytic Extension Framework
UDX C++ APIUDX C++ API
Canned AnalyticsCanned Analytics
Application IntegrationApplication Integration
AE FrameworkAE Framework In-DB RIn-DB R In-DB LUAIn-DB LUAIn-DB PythonIn-DB Python In-DB PerlIn-DB Perl
OLAP FunctionsOLAP Functions
ROW_NUMBERROW_NUMBER
RANKRANK
LAGLAG LEADLEAD
DENSE_RANKDENSE_RANK Linear RegressionLinear Regression
Kmeans
Clustering
Kmeans
Clustering Decision TreeDecision Tree
Association RulesAssociation Rules
Association RulesAssociation Rules
Naive BayesNaive Bayes
Spatial OperatorsSpatial Operators
ContainsContains
TouchesTouches
WithinWithin
IntersectsIntersects
CrossesCrosses
OverlapsOverlaps
R WrapperR Wrapper Watson AnalyticsWatson Analytics ESRI ArcGIS
Connector
ESRI ArcGIS
Connector ……
Analytics Applications of ISVs and CustomersAnalytics Applications of ISVs and Customers
STDDEVSTDDEV
COVARCOVAR
…………
22. Analytic Code &
Algorithms:
Analytic Data:
Data pulled out and processed in analytic
application
Analytic
Applications
This is where we start from: All analytic processing done on application side
Analytics of Warehouse Data
23. SQLs
Analytic Code &
Algorithms:
Analytic Data:
Simple data lookup & massage operations
pushed down as SQL operations
Analytic
Applications
Benefit: Acceleration with no SQL skills required
SQLs
Push Down Step 1: BLU tables only logically represented in analytic application
Accelerate Analytics for Warehouse Data
24. SQLs
Analytic Code &
Algorithms:
Analytic Data:
Call built-in functions via SQL to execute
typical algorithms inside db
Cloud Tooling
Analytic
Applications
Benefit: Bring Standard Analytics to the Data
SQLs
Canned Algorithms
Push Down Step 2: Typical and popular algorithms pushed down to canned UDFs in the db
Accelerate Analytics for Warehouse Data
25. LanguageFramework
(UDX&AE)
Analytic Code &
Algorithms:
Analytic Data:
Deploy customer code and call via special
SQL function interfaces
SQLs
SQLs
Canned Algorithms
Analytic
Applications
Benefit: Bring Custom Analytics to the Data
Push Down Step 3: Execute entire customer analytic programs inside the db
Accelerate Analytics for Warehouse Data
26. Don’t forget to submit your Insight session and speaker feedback! Your
feedback is very important to us – we use it to continually improve the
conference.
Access your surveys at insight2015survey.com to quickly submit your surveys
from your smartphone, laptop or conference kiosk.
We Value Your Feedback!
26
28. 28
Notices and Disclaimers (con’t)
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly
available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance,
compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the
suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to
interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights,
trademarks or other intellectual property right.
•IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DB2® , DOORS®, Emptoris®, Enterprise
Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM
SmartCloud®, IBM Social Business®, IMS™, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON,
OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®,
pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®,
Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International
Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or
other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at:
www.ibm.com/legal/copytrade.shtml.
Dzięki znajomości liczby połączeń dla obszaru można lepiej planować dodanie nowych wież w celu poprawy jakości usług.
Planowanie rozmieszczenia nowych stacji bazowych.
Czas dojazdu pomiędzy daną nieruchomością a najbliższą stacją straży pożarnej może mieć wpływ na koszt składki ubezpieczeniowej.
Spatial functions can be used to return a value in the select list of a query.
In the first example, the ST_Distance function is being used to return the distance between a customer and a store.
Spatial functions can also be used in the WHERE clause of a query, in the first example to consider only the customers who are within 10,000 meters of a store for stores in New York state.
The second example is finding the highways that intersect a floodzone where the date of the last flood was after 1950.
A point value can be created by specifying an x, y and spatial reference system identifier.
When working with coordinates in degrees, longitude is used for x and latitude is used for y.
All of the spatial constructors can accept well-known text, well-known binary or shape representations although only well-known text is straightforward to specify as a character string constant as shown in these examples of creating a point and linestring value.
An application can provide the source data as a host variable associated with any of the supported representations.
Most useful spatial queries involve a where clause that tests the relationship between spatial values in two tables. We refer to this as a spatial join.
When query performs a spatial join, the query optimizer will examine the available spatial indexes and exploit a spatial index which dramatically reduces computation.
The most commonly used queries test the distance between spatial values in two tables and to test whether the points in one table fall within a set of polygons defined in another table.
In the case of relating points and polygons, the contains, within and intersects operations are very similar.
The crosses, equals, overlaps and touches predicates are available but are not used as commonly.
The predicates I just mentioned compare each point or segment in one geometry with each point or line in the other so this can be a fairly computationally intensive process for complex objects.
The EnvelopesIntersect predicate compares the envelope of one geometry with the envelope of another geometry which is a very fast and efficient calculation but not as precise. Two signatures are provided for this predicate, the first uses two spatial values or columns. The second typically references a spatial column and the coordinates of a rectangular region. This is most commonly used to quickly select objects which intersect a display window.
The last example, ST_Area, would not be eligible for index exploitation because the geometry areas are not indexed. This example might be useful if you were looking for service territories or lakes larger than a particular size.
I’ve listed here a few of the more commonly used functions that operate on one or more spatial values to return a new spatial value.
The buffer function takes any spatial value and returns a new spatial value created with a buffer of the specified size.
The centroid function takes any spatial value and returns a point spatial value corresponding to the geometric center.
The intersection function computes the intersection of two spatial values and returns this as a new spatial value.
The union function returns a multi-part spatial value composed of the two input spatial values.
If we look at functions that return information about a spatial value, we can get the area of a polygon or the length of a line.
We can get the minimum and maximum x and y values of a spatial value.
Although we most often work with 2-dimensional spatial values, in addition to an x and y, we can associate a z and/or a measure or m value. The z value is most often used for elevation and the m value is used to record distance along a line, like a milepost. We have functions to determine whether z or m values are present in a spatial value.
For point spatial values we can select any of the individual coordinate values for x, y, z, and m.
Lastly, we can use the AsText function to return the well-known text representation of a spatial value which can be useful in some applications.
There is quite a long list of spatial functions which are shown here.
The long list in green is the set of functions that are in the SQL spatial standards.
There are also a number of additional functions provided by Spatial Extender simplify creating spatial values and support for linear referencing and spatial aggregation.
The spatial functions fall into a number of categories which I will talk about further and show some of the mostly commonly used functions.
Since Spatial Extender is implemented with standard DB2 capabilities, this allows you to harness the full power of SQL in conjunction with spatial processing. We show here just some of the standard SQL capabilities that can be used with spatial processing.
The query shown here uses a common table expression to select the stores that are within the San Diego area. It then uses an aggregate function to get the average income of households that are in the sales zone of each store and orders the result by store name.
Value: Data Analysts can use SQL (R Skill are sufficient) -&gt; we speak language of analysts
Value: Bring Standard Analytics to data
Value: Bring Customer Analytic Functions to the data
ToDo: Auf charts value bringen