SlideShare a Scribd company logo
© COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Geospatial Applications created using
JavaScript (and NoSQL)
Tamas Piros (@tpiros | me.tamas.io)
SLIDE: 2 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Agenda
▪ What is full stack JavaScript and why should you care?
▪ What is geospatial data?
▪ How is this related to NoSQL and databases?
▪ JSON data
▪ Server Side JavaScript
▪ Node.js
▪ Demo
SLIDE: 3 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
JavaScript is eating the world
SLIDE: 4 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
And if you need more convincing
SLIDE: 5 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
A bit more on JavaScript
▪ JavaScript has been around, it is here now and will be here for a while (whether
you like it / use it or not)
▪ Ruling the browser since ‘95
<html>
<body>
<script src="jquery.js"></script>
<script>
$.ajax({ url: "/items" }).done(function(html) {
$("#results").append(html);
});
</script>
</body>
</html>
AJAX & jQuery era
● Asynchronous requests to websites
● Page updates & data loads, without the need to reload the site
● First real step towards interactive websites
SLIDE: 7 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
The evolution of JS frameworks / libraries
▪ And a ‘few’ frameworks and libraries followed
▪ AngularJS
▪ Ember
▪ Knockout
▪ React
▪ Backbone
▪ Dojo
▪ ExtJS
▪ D3.js
▪ Velocity
▪ etc etc etc
var http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, {
'Content-type': 'text/plain'
});
response.write('hello node');
response.end();
});
server.listen(8080);
JavaScript at the server-side
● Ubiquity in the browser had trickled down the stack
● You can run JavaScript at the server-side
● It’s fast - asynchronous & non-blocking
SLIDE: 9 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
The future of JavaScript
▪ JavaScript has a prosperous future ES6/2015 and ES7/2016
▪ classes
▪ arrow functions
▪ string templates
▪ promises
▪ object destructuring
▪ array includes
▪ async functions
▪ rest parameters
SLIDE: 10 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Geospatial data
- data represents geographical information which can include site locations (as
well as vectors and raster data)
- (site) locations are made up of (geospatial) points
- (geospatial) points can be placed on a coordinate system and they consist of a
pair of latitude and longitude values
SLIDE: 11 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Geospatial data
Munich: (+) 48.1351° N, (+) 11.5820° E
Sydney: (-) 33.8600° S, (+) 151.2094° E
SLIDE: 12 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Exif data
Exchangeable image file
format (standard)
- metadata about
images (and sounds)
- make, model,
orientation, exposure
time, creation date,
focal length, …
- with location services
on: GPS data
Let’s put all this together
SLIDE: 14 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Application Architecture
User Interface
● Data views
● User workflow
● Browser
Middle-tier
● Business rules
● Application logic
JSON over HTTP
Pros
● Same language throughout the stack
● Lightweight data format
● Data format ‘natively’ understood by
JavaScript
Con(s)
● Missing persistent data storage
SLIDE: 15 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Application Architecture
User Interface
● Data views
● User workflow
● Browser
Middle-tier
● Business rules
● Application logic
JSON over HTTP
Wouldn’t it be nice to add a
database to this architecture that
can:
● store JSON documents natively (along
with XML, binary and RDF)?
● allow you to construct queries using
JavaScript?
● have ACID properties instead of
eventual consistency?
● Give you all the indexes you need and
allow you to execute search out of the
box?
● Apply role based, document level
security?
● Execute SPARQL queries?
● Manage the database via REST API
calls?
SLIDE: 16 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Application Architecture
User Interface
● Data views
● User workflow
● Browser
Middle-tier
● Business rules
● Application logic
JSON over HTTP
MarkLogic can:
● store JSON documents natively (along
with XML, binary and RDF)
● allow you to construct queries using
JavaScript
● have ACID properties instead of
eventual consistency
● Give you all the indexes you need and
allow you to execute search out of the
box
● Apply role based, document level
security
● Execute SPARQL queries
● Manage the database via REST API
calls
JSON/XML over HTTP
Database-tier
● Persistent storage
SLIDE: 17 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
- support for WGS84 coordinate system as well as raw coordinate system
- support for geospatial queries, indexes and shapes
- points, (complex) polygons, circles, boxes
- support for Well-Known Text (WKT) and Well-Known Binary (WKB)
representation of geospatial data
- point, linestring, triangle, multipoint, multilinestring, multipolygon,
geometrycollection
Geospatial data in MarkLogic
var latitude = 10.3910;
var longitude = -75.4794;
var miles = function(distance) { return distance * 1.60934 };
cts.search(cts.jsonPropertyChildGeospatialQuery('location',
'coordinates',
cts.circle(miles(5), cts.point(latitude, longitude))
));
Server-side JavaScript in MarkLogic
● Runs on Google’s V8 engine (JavaScript compiler)
● Allows you to execute JavaScript code close to your data (“stored procedures”)
○ both native JavaScript (including some ES2015) and proprietary JavaScript
var marklogic = require('marklogic');
var db = marklogic.createDatabaseClient
(connection);
var qb = marklogic.queryBuilder;
db.documents.query(
qb.where(
qb.geospatial(
qb.geoProperty(
qb.property('location'),
qb.property('coordinates')),
qb.circle(10, 10.3910, -75.4794)
)
)
).result().then(function(response) {
console.log(response);
});
Node.js Client API
● Registered npm package
● Focus on application
features rather than
plumbing:
○ read/write (bulk), patch
(updates), queries,
projections, extensions,
alerting, semantics …
● Supports all geospatial
query types
Demo
SLIDE: 21 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Resources
- Get the database for free!
- GeoPhoto (GitHub)
- Samplestack (GitHub)
- Character Search v1 (GitHub)
- Character Search v2 (GitHub)
- MarkLogic Java API (GitHub)
- MarkLogic Node.js API (GitHub)
- How is MarkLogic different from MongoDB? (Article)
- Free Training
- More on MarkLogic’s Node.js API (free training)
SLIDE: 22 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.
Danke schön!

More Related Content

PPTX
Why is postgis awesome?
PDF
MongoDB + GeoServer
PPT
Open Source Databases And Gis
PDF
Advanced Cartographic Map Rendering In GeoServer
PPT
Fosdem 2010 GT.M and OpenStreetMap
PDF
Lost In The Clouds
PDF
Using python to analyze spatial data
PDF
Nokia Asha webinar: Developing location-based services for Nokia Asha phones ...
Why is postgis awesome?
MongoDB + GeoServer
Open Source Databases And Gis
Advanced Cartographic Map Rendering In GeoServer
Fosdem 2010 GT.M and OpenStreetMap
Lost In The Clouds
Using python to analyze spatial data
Nokia Asha webinar: Developing location-based services for Nokia Asha phones ...

What's hot (20)

PDF
Location based services for Nokia X and Nokia Asha using Geo2tag
ODP
Introduction To PostGIS
PDF
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
PPTX
Serving earth observation data with GeoServer: addressing real world requirem...
PPTX
Phnom penh mapping meetup #15
PPT
M/DB and M/DB:X
PPTX
Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...
PDF
One GeoNode, many GeoNodes
PDF
GeoServer on steroids
PPTX
GeoServer in Production: we do it, here is how!
PDF
State of GeoServer - FOSS4G 2016
PDF
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
PPTX
RTree Spatial Indexing with MongoDB - MongoDC
PDF
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
PPTX
Open Source Web Charts
PPTX
Making data storage more efficient
PDF
PINOGIO : A simple way to create a web infographic map (피노지오 : 웹 인포그래픽 맵을 만드는...
PDF
Developing Geospatial software with Python, Part 1
PPTX
Serving earth observation data with GeoServer: addressing real world requirem...
PDF
Gfoss 2010
Location based services for Nokia X and Nokia Asha using Geo2tag
Introduction To PostGIS
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Serving earth observation data with GeoServer: addressing real world requirem...
Phnom penh mapping meetup #15
M/DB and M/DB:X
Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...
One GeoNode, many GeoNodes
GeoServer on steroids
GeoServer in Production: we do it, here is how!
State of GeoServer - FOSS4G 2016
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
RTree Spatial Indexing with MongoDB - MongoDC
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
Open Source Web Charts
Making data storage more efficient
PINOGIO : A simple way to create a web infographic map (피노지오 : 웹 인포그래픽 맵을 만드는...
Developing Geospatial software with Python, Part 1
Serving earth observation data with GeoServer: addressing real world requirem...
Gfoss 2010
Ad

Viewers also liked (15)

PDF
SPARK STREAMING Spark Hadoop User Group Munich Meetup 2016
PDF
Caching and JCache with Greg Luck 18.02.16
PDF
Machinelearning Spark Hadoop User Group Munich Meetup 2016
PDF
Building a fully-automated Fast Data Platform
PDF
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
PDF
Grundlegende Konzepte von Elm, React und AngularDart 2 im Vergleich
PPTX
Ein Prozess lernt laufen: LEGO Mindstorms Steuerung mit BPMN
PDF
Writing Java EE microservices using WildFly Swarm
PPTX
Apache Apex: Stream Processing Architecture and Applications
PDF
21.04.2016 Meetup: Spark vs. Flink
PDF
Java cro 2016 - From.... to Scrum by Jurica Krizanic
PDF
MongoDB: The Operational Big Data by NORBERTO LEITE at Big Data Spain 2014
PDF
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
PPTX
MongoDB
PDF
Distributed Computing and Caching in the Cloud: Hazelcast and Microsoft
SPARK STREAMING Spark Hadoop User Group Munich Meetup 2016
Caching and JCache with Greg Luck 18.02.16
Machinelearning Spark Hadoop User Group Munich Meetup 2016
Building a fully-automated Fast Data Platform
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
Grundlegende Konzepte von Elm, React und AngularDart 2 im Vergleich
Ein Prozess lernt laufen: LEGO Mindstorms Steuerung mit BPMN
Writing Java EE microservices using WildFly Swarm
Apache Apex: Stream Processing Architecture and Applications
21.04.2016 Meetup: Spark vs. Flink
Java cro 2016 - From.... to Scrum by Jurica Krizanic
MongoDB: The Operational Big Data by NORBERTO LEITE at Big Data Spain 2014
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
MongoDB
Distributed Computing and Caching in the Cloud: Hazelcast and Microsoft
Ad

Similar to Geospatial applications created using java script(and nosql) (20)

PDF
Volume 2-issue-6-2030-2033
PDF
Volume 2-issue-6-2030-2033
PDF
We are the music makers and we are the dreamers of dreams
PPTX
Going Mobile with HTML5
PDF
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
PPTX
Break on Through (To The Java(Script) Side) - Smart Development - Esri UK Ann...
PDF
Intro To Geospatial
PPTX
Mobile LBS
PDF
iTimer - Count On Your Time
PPT
An Overview of Web GIS and Location Based Services
PPTX
LocationTech Projects
PPTX
6.1 GeospatialWeb101.pptx.pptx
ODP
Geodjango and HTML 5
PDF
FIWARE Developers Week_BootcampWeBUI_presentation2
PPTX
Use of FOSS4G in hybrid systems
PPT
Netek - On-screen Editing of Map Content via Web Browser in Real Time
PDF
GITA PNW 2015 Peter Batty
PPTX
Crawlable Spatial Data - #Geo4Web research topic #3
PPT
Geodjango
PPT
Geodjango
Volume 2-issue-6-2030-2033
Volume 2-issue-6-2030-2033
We are the music makers and we are the dreamers of dreams
Going Mobile with HTML5
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
Break on Through (To The Java(Script) Side) - Smart Development - Esri UK Ann...
Intro To Geospatial
Mobile LBS
iTimer - Count On Your Time
An Overview of Web GIS and Location Based Services
LocationTech Projects
6.1 GeospatialWeb101.pptx.pptx
Geodjango and HTML 5
FIWARE Developers Week_BootcampWeBUI_presentation2
Use of FOSS4G in hybrid systems
Netek - On-screen Editing of Map Content via Web Browser in Real Time
GITA PNW 2015 Peter Batty
Crawlable Spatial Data - #Geo4Web research topic #3
Geodjango
Geodjango

More from Comsysto Reply GmbH (12)

PDF
Architectural Decisions: Smoothly and Consistently
PDF
ljug-meetup-2023-03-hexagonal-architecture.pdf
PDF
Software Architecture and Architectors: useless VS valuable
PDF
Invited-Talk_PredAnalytics_München (2).pdf
PDF
MicroFrontends für Microservices
PDF
Alles offen = gut(ai)
PDF
Bable on Smart City Munich Meetup: How cities are leveraging innovative partn...
PDF
Smart City Munich Kickoff Meetup
PDF
Data Reliability Challenges with Spark by Henning Kropp (Spark & Hadoop User ...
PDF
"Hadoop Data Lake vs classical Data Warehouse: How to utilize best of both wo...
PDF
Data lake vs Data Warehouse: Hybrid Architectures
PPTX
Java 9 Modularity and Project Jigsaw
Architectural Decisions: Smoothly and Consistently
ljug-meetup-2023-03-hexagonal-architecture.pdf
Software Architecture and Architectors: useless VS valuable
Invited-Talk_PredAnalytics_München (2).pdf
MicroFrontends für Microservices
Alles offen = gut(ai)
Bable on Smart City Munich Meetup: How cities are leveraging innovative partn...
Smart City Munich Kickoff Meetup
Data Reliability Challenges with Spark by Henning Kropp (Spark & Hadoop User ...
"Hadoop Data Lake vs classical Data Warehouse: How to utilize best of both wo...
Data lake vs Data Warehouse: Hybrid Architectures
Java 9 Modularity and Project Jigsaw

Recently uploaded (20)

PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
Database Infoormation System (DBIS).pptx
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PDF
Business Analytics and business intelligence.pdf
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PDF
Mega Projects Data Mega Projects Data
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Business Ppt On Nestle.pptx huunnnhhgfvu
Acceptance and paychological effects of mandatory extra coach I classes.pptx
climate analysis of Dhaka ,Banglades.pptx
Introduction to Knowledge Engineering Part 1
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Supervised vs unsupervised machine learning algorithms
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Database Infoormation System (DBIS).pptx
IB Computer Science - Internal Assessment.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Business Analytics and business intelligence.pdf
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Mega Projects Data Mega Projects Data
iec ppt-1 pptx icmr ppt on rehabilitation.pptx

Geospatial applications created using java script(and nosql)

  • 1. © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Geospatial Applications created using JavaScript (and NoSQL) Tamas Piros (@tpiros | me.tamas.io)
  • 2. SLIDE: 2 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Agenda ▪ What is full stack JavaScript and why should you care? ▪ What is geospatial data? ▪ How is this related to NoSQL and databases? ▪ JSON data ▪ Server Side JavaScript ▪ Node.js ▪ Demo
  • 3. SLIDE: 3 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. JavaScript is eating the world
  • 4. SLIDE: 4 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. And if you need more convincing
  • 5. SLIDE: 5 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. A bit more on JavaScript ▪ JavaScript has been around, it is here now and will be here for a while (whether you like it / use it or not) ▪ Ruling the browser since ‘95
  • 6. <html> <body> <script src="jquery.js"></script> <script> $.ajax({ url: "/items" }).done(function(html) { $("#results").append(html); }); </script> </body> </html> AJAX & jQuery era ● Asynchronous requests to websites ● Page updates & data loads, without the need to reload the site ● First real step towards interactive websites
  • 7. SLIDE: 7 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. The evolution of JS frameworks / libraries ▪ And a ‘few’ frameworks and libraries followed ▪ AngularJS ▪ Ember ▪ Knockout ▪ React ▪ Backbone ▪ Dojo ▪ ExtJS ▪ D3.js ▪ Velocity ▪ etc etc etc
  • 8. var http = require('http'); var server = http.createServer(function(request, response) { response.writeHead(200, { 'Content-type': 'text/plain' }); response.write('hello node'); response.end(); }); server.listen(8080); JavaScript at the server-side ● Ubiquity in the browser had trickled down the stack ● You can run JavaScript at the server-side ● It’s fast - asynchronous & non-blocking
  • 9. SLIDE: 9 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. The future of JavaScript ▪ JavaScript has a prosperous future ES6/2015 and ES7/2016 ▪ classes ▪ arrow functions ▪ string templates ▪ promises ▪ object destructuring ▪ array includes ▪ async functions ▪ rest parameters
  • 10. SLIDE: 10 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Geospatial data - data represents geographical information which can include site locations (as well as vectors and raster data) - (site) locations are made up of (geospatial) points - (geospatial) points can be placed on a coordinate system and they consist of a pair of latitude and longitude values
  • 11. SLIDE: 11 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Geospatial data Munich: (+) 48.1351° N, (+) 11.5820° E Sydney: (-) 33.8600° S, (+) 151.2094° E
  • 12. SLIDE: 12 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Exif data Exchangeable image file format (standard) - metadata about images (and sounds) - make, model, orientation, exposure time, creation date, focal length, … - with location services on: GPS data
  • 13. Let’s put all this together
  • 14. SLIDE: 14 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Application Architecture User Interface ● Data views ● User workflow ● Browser Middle-tier ● Business rules ● Application logic JSON over HTTP Pros ● Same language throughout the stack ● Lightweight data format ● Data format ‘natively’ understood by JavaScript Con(s) ● Missing persistent data storage
  • 15. SLIDE: 15 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Application Architecture User Interface ● Data views ● User workflow ● Browser Middle-tier ● Business rules ● Application logic JSON over HTTP Wouldn’t it be nice to add a database to this architecture that can: ● store JSON documents natively (along with XML, binary and RDF)? ● allow you to construct queries using JavaScript? ● have ACID properties instead of eventual consistency? ● Give you all the indexes you need and allow you to execute search out of the box? ● Apply role based, document level security? ● Execute SPARQL queries? ● Manage the database via REST API calls?
  • 16. SLIDE: 16 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Application Architecture User Interface ● Data views ● User workflow ● Browser Middle-tier ● Business rules ● Application logic JSON over HTTP MarkLogic can: ● store JSON documents natively (along with XML, binary and RDF) ● allow you to construct queries using JavaScript ● have ACID properties instead of eventual consistency ● Give you all the indexes you need and allow you to execute search out of the box ● Apply role based, document level security ● Execute SPARQL queries ● Manage the database via REST API calls JSON/XML over HTTP Database-tier ● Persistent storage
  • 17. SLIDE: 17 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. - support for WGS84 coordinate system as well as raw coordinate system - support for geospatial queries, indexes and shapes - points, (complex) polygons, circles, boxes - support for Well-Known Text (WKT) and Well-Known Binary (WKB) representation of geospatial data - point, linestring, triangle, multipoint, multilinestring, multipolygon, geometrycollection Geospatial data in MarkLogic
  • 18. var latitude = 10.3910; var longitude = -75.4794; var miles = function(distance) { return distance * 1.60934 }; cts.search(cts.jsonPropertyChildGeospatialQuery('location', 'coordinates', cts.circle(miles(5), cts.point(latitude, longitude)) )); Server-side JavaScript in MarkLogic ● Runs on Google’s V8 engine (JavaScript compiler) ● Allows you to execute JavaScript code close to your data (“stored procedures”) ○ both native JavaScript (including some ES2015) and proprietary JavaScript
  • 19. var marklogic = require('marklogic'); var db = marklogic.createDatabaseClient (connection); var qb = marklogic.queryBuilder; db.documents.query( qb.where( qb.geospatial( qb.geoProperty( qb.property('location'), qb.property('coordinates')), qb.circle(10, 10.3910, -75.4794) ) ) ).result().then(function(response) { console.log(response); }); Node.js Client API ● Registered npm package ● Focus on application features rather than plumbing: ○ read/write (bulk), patch (updates), queries, projections, extensions, alerting, semantics … ● Supports all geospatial query types
  • 20. Demo
  • 21. SLIDE: 21 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Resources - Get the database for free! - GeoPhoto (GitHub) - Samplestack (GitHub) - Character Search v1 (GitHub) - Character Search v2 (GitHub) - MarkLogic Java API (GitHub) - MarkLogic Node.js API (GitHub) - How is MarkLogic different from MongoDB? (Article) - Free Training - More on MarkLogic’s Node.js API (free training)
  • 22. SLIDE: 22 © COPYRIGHT 2016 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Danke schön!