SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Drupal and Outer 
Space
A Game Changer for the Geospatial Data Market 
Dauria Aerospace 
develops new ways in 
building low cost 
satellites, thus reducing 
costs for earth 
observation data 
drastically. 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Game Changer for the Geospatial Data Market 
Affordable Geo data allow 
small businesses to pioneer 
new business models. 
Example: 
Low cost parcel monitoring 
service for local farmers 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Building Satellites with Smartphone Technology 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Building Lightweight Satellites 
Conventional Satellite 
New Satellite 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Less Expensive Launches 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
We need a Configurable Product with a Map 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Commerce's Standard Handling of Product Variations 
http://demo.commerceguys.com/ck/tops/guy-short-sleeve-tee 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Customizable Products Module 
As the ancient 
Drupal Proverb goes: 
There's a module 
for that 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Configuration of References 
Content Type for the 
Product Display 
Configuration: 
Add Product Reference 
Set „Product Types that 
can be referenced“ 
to Product Type; 
Set „Add to Cart Line 
Item Type“ 
to Line Item Type 
Product Display Node 
Configuration: 
Set „Product Reference“ 
to Product 
Product Type 
Configuration: 
Set „Default Reference“ 
to Content Type 
Product 
Configuration: 
Set „Referenced by“ 
to Product 
Display Node 
Line Item Type 
Configuration: 
Set „Add to Cart Line 
Item Type“ 
to itself (self reference!) 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Validating User Inputs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Validating User Inputs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Validating User Inputs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Validating User Inputs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Validating User Inputs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Utilizing PostGIS 
PostGIS extends PostgreSQL Databases with geodetic functions 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The PostGIS Module integrates this Functions into Drupal 
class PostgisGeometry { 
... 
function validate() { 
$geo = is_null($this->wkt) ? $this->geometry : $this->wkt; 
try { 
$result = db_query("SELECT ST_GeometryType(:geo), ST_IsValid(:geo), ST_IsValidReason(:geo) as reason", 
array(':geo' => $geo))->fetchAssoc(); 
// Return reason if geometry is not valid. 
if (!$result['st_isvalid']) { 
return array( 
'error' => 'postgis_unparsable', 
'message' => t('Not a valid geometry: @reason.', array('@reason' => $result['reason'])), 
); 
} 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
... 
} 
catch (PDOException $e) { 
// TODO: catch only WKT parse errors. 
return array( 
'error' => 'postgis_unparsable', 
'message' => t('Unable to parse WKT: ' . $geo), 
); 
} 
}
But the PostGIS Module has some Weaknesses 
/** 
* Calculates diffrence to a given geometry. 
* 
* @param PostgisGeometry $geometry 
* Geometry which this instance will be compared to. 
* 
* @return PostgisGeometry 
* Geometry of diffrence. 
*/ 
function diff($geometry) { 
... 
$geo_diff = db_query("SELECT ST_Union(ST_Difference(:geo_a, :geo_b), ST_Difference(:geo_b, :geo_a))", 
array(':geo_a' => $geo_a, ':geo_b' => $geo_b))->fetchField(); 
$geo_type = db_query("SELECT GeometryType(:geo_diff)", 
array(':geo_diff' => $geo_diff))->fetchField(); 
$diff = new PostgisGeometry($geo_type, $this->srid); 
$diff->fromGeometry($geo_diff); 
return $diff; 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
} 
- Some important geodetic functions are not implemented 
- Error handling is inconsistent
Extending and Overwriting the PostGIS Module 
class PostgisGeometries extends PostgisGeometry { 
... 
function intersects($geometry) { 
if ((get_class($geometry) !== 'postgis_geometry') && (get_class($geometry) !== 'PostgisGeometries')) { 
throw new PostgisGeometryException('not postgis_geometry'); 
} 
try { 
$geo_a = $this->getText(); 
if(stripos($geo_a,'GEOMETRYCOLLECTION(' ) === 0) { 
$geo_a = substr(strstr($geo_a, '('),1, -1); 
} 
$geo_b = $geometry->getText(); 
if(stripos($geo_b,'GEOMETRYCOLLECTION(' ) === 0) { 
$geo_b = substr(strstr($geo_b, '('),1, -1); 
} 
$intersects = db_query("SELECT ST_Intersects(text :geo_a, text :geo_b)", 
array(':geo_a' => $geo_a, ':geo_b' => $geo_b))->fetchField(); 
return $intersects; 
} 
catch (PDOException $e) { 
throw new PostgisGeometryException( $e->getMessage( ) , (int)$e->getCode( ) ); 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
} 
}
Writing a module to validate the AOI and calculate the price 
function water_quality_form_alter(&$form, &$form_state, $form_id) { 
... 
$form['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']['#element_validate'][] = 
'water_quality_aoi_validate'; 
... 
function water_quality_aoi_validate($element, &$form_state) { 
... 
$coverage_region_comparison->transform($aoi->getSrid()); 
$coverage_region_comparison->dump(); 
$intersects_google_projection = $coverage_region_comparison->intersects($aoi_comparison); 
if ($intersects_google_projection){ 
// Convert aoi to srid of the region. 
$aoi_comparison->transform($coverage_region['region']->getSrid()); 
$aoi_comparison->dump(); 
// check if the aoi intersects with the region. This needs to be 
// done in the SRID of the coverage region for accuracy. 
$within = $aoi_comparison->within($coverage_region['region']); 
if ($within){ 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
... 
...
The Open Layers Editor has some Bugs 
What it 
should deliver 
POLYGON((1066993.16984217 4873953.49407963, 
1340943.47921804 5392502.29411237, 
1810572.58092165 5382718.35450175, 
1979345.539345157 5106322.0602720035, 
1849708.33939679 4776114.09813913, 
1066993.16984217 4873953.49407963)) 
GEOMETRYCOLLECTION( 
POLYGON((1066993.16984217 4873953.49407963, 
1340943.47921804 5392502.29411237, 
1810572.58092165 5382718.35450175, 
1979345.539345157 5106322.0602720035, 
1849708.33939679 4776114.09813913, 
1066993.16984217 4873953.49407963)), 
POINT(1203968.324530105 5133227.894096), 
POINT(1575758.0300698448 5387610.32430706), 
POINT(1894959.0601334036 5244520.207386877), 
POINT(1914526.9393709735 4941218.079205567), 
POINT(1458350.75461948 4825033.79610938), 
POINT(1066993.16984217 4873953.49407963), 
POINT(1340943.47921804 5392502.29411237), 
POINT(1810572.58092165 5382718.35450175), 
POINT(1979345.539345157 5106322.0602720035), 
POINT(1849708.33939679 4776114.09813913)) 
What it 
sometimes 
delivers 
GEOMETRYCOLLECTION() 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Open Layers Editor has some Bugs 
Caching and the 
Open Layers Editor 
have an awkward 
relationship 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Open Layers Editor has some Bugs 
function water_quality_form_alter(&$form, &$form_state, $form_id) { 
... 
... 
function water_quality_subscription_type_validate($element, &$form_state) { 
if(!isset($element['#value']) || empty($element['#value'])){ 
drupal_rebuild_form($form_state['build_info']['form_id'], $form_state); 
} 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
} 
function eomap_eula_validate($element, &$form_state) { 
if(!isset($element['#value']) || empty($element['#value'])){ 
drupal_rebuild_form($form_state['build_info']['form_id'], $form_state); 
form_set_error('field_line_item_map', t('Agreement to Product EULA must be checked')); 
} 
} 
$form['line_item_fields']['field_subscription_type'][LANGUAGE_NONE]['#element_validate'][] = 
'water_quality_subscription_type_validate'; 
$form['line_item_fields']['field_eomap_eula_agreement'][LANGUAGE_NONE]['#element_validate'][] = 
'eomap_eula_validate'; 
... 
... 
}
The Open Layers Editor has some Bugs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Open Layers Editor has some Bugs 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The Open Layers Editor has some Bugs 
$form_state['no_cache'] = TRUE; 
if (isset($form_state['values']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'])){ 
$form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'] = 
$form_state['values']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']; 
} else { 
if (isset($form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'])){ 
$wkt = $form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']; 
if(stripos($wkt, 'POINT') !== false){ 
$wkt = substr(strstr($wkt, '('), 1,(stripos($wkt, ',POINT') - stripos($wkt, '(') -1)); 
} 
$form['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']['#value'] = $wkt; 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org 
} 
} 
Some form fields mysteriously loose 
their value and need to be refilled
Wrapping it up: Placing the Geo 
Data Product in the Shopping Cart 
A Rule 
overwrites 
the line item 
price with 
the calculated 
price 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Wrapping it up: Placing the Geo 
Data Product in the Shopping Cart 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
What it's all about... 
You can build some such thing 
and even more sophisticated 
sites with Drupal modules 
and a little coding! 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
Any Questions? 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
The End 
Спасибо за внимание 
Спасибі за увагу 
Danke für Ihre Aufmerksamkeit 
Thank you for your attention 
Translated to a select 
choice of languages 
of planet Earth: 
Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org

Mais conteúdo relacionado

Destaque

Ask not only what your Drupal can do for you, ask what you can do for your Dr...
Ask not only what your Drupal can do for you, ask what you can do for your Dr...Ask not only what your Drupal can do for you, ask what you can do for your Dr...
Ask not only what your Drupal can do for you, ask what you can do for your Dr...DrupalCamp MSK
 
Git - Вадим Валуев
Git - Вадим ВалуевGit - Вадим Валуев
Git - Вадим ВалуевDrupalCamp MSK
 
Создание первого ИТ-кооператива в России - Станислав Новиков
Создание первого ИТ-кооператива в России - Станислав НовиковСоздание первого ИТ-кооператива в России - Станислав Новиков
Создание первого ИТ-кооператива в России - Станислав НовиковDrupalCamp MSK
 
Открытые данные, как инструмент создания собственных коммерческих приложений ...
Открытые данные, как инструмент создания собственных коммерческих приложений ...Открытые данные, как инструмент создания собственных коммерческих приложений ...
Открытые данные, как инструмент создания собственных коммерческих приложений ...DrupalCamp MSK
 
Freelancers Unite! - Martin Mayer
Freelancers Unite! - Martin MayerFreelancers Unite! - Martin Mayer
Freelancers Unite! - Martin MayerDrupalCamp MSK
 
Облачные технологии, которые упрощают жизнь разработчикам - Игорь Лукянов
Облачные технологии, которые упрощают жизнь разработчикам - Игорь ЛукяновОблачные технологии, которые упрощают жизнь разработчикам - Игорь Лукянов
Облачные технологии, которые упрощают жизнь разработчикам - Игорь ЛукяновDrupalCamp MSK
 
Направление: Вектор - Евгений Юртаев
Направление: Вектор - Евгений ЮртаевНаправление: Вектор - Евгений Юртаев
Направление: Вектор - Евгений ЮртаевDrupalCamp MSK
 
Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...
 Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе... Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...
Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...DrupalCamp MSK
 
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...DrupalCamp MSK
 
Создание каталога на D7 и фасетный поиск по нему - Андрей Токмаков
Создание каталога на D7 и фасетный поиск по нему - Андрей ТокмаковСоздание каталога на D7 и фасетный поиск по нему - Андрей Токмаков
Создание каталога на D7 и фасетный поиск по нему - Андрей ТокмаковDrupalCamp MSK
 
Drupal в облаке - Владимир Юнев
Drupal в облаке - Владимир ЮневDrupal в облаке - Владимир Юнев
Drupal в облаке - Владимир ЮневDrupalCamp MSK
 
От фрилансера до веб-студии за 5 шагов - Геннадий Колтун
От фрилансера до веб-студии за 5 шагов - Геннадий КолтунОт фрилансера до веб-студии за 5 шагов - Геннадий Колтун
От фрилансера до веб-студии за 5 шагов - Геннадий КолтунDrupalCamp MSK
 
lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...
 lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p... lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...
lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...Natalia Gatmaniuc
 
Опыт Drupal разработчика на бирже oDesk - Петр Лозовицкий
Опыт Drupal разработчика на бирже oDesk - Петр ЛозовицкийОпыт Drupal разработчика на бирже oDesk - Петр Лозовицкий
Опыт Drupal разработчика на бирже oDesk - Петр ЛозовицкийDrupalCamp MSK
 
Quality Control Tests for Herbal Drugs
Quality Control Tests for Herbal DrugsQuality Control Tests for Herbal Drugs
Quality Control Tests for Herbal DrugsMuhammad Asad
 
Efficacy and Potency of drug
Efficacy and Potency of drugEfficacy and Potency of drug
Efficacy and Potency of drugMuhammad Asad
 

Destaque (17)

Ask not only what your Drupal can do for you, ask what you can do for your Dr...
Ask not only what your Drupal can do for you, ask what you can do for your Dr...Ask not only what your Drupal can do for you, ask what you can do for your Dr...
Ask not only what your Drupal can do for you, ask what you can do for your Dr...
 
Git - Вадим Валуев
Git - Вадим ВалуевGit - Вадим Валуев
Git - Вадим Валуев
 
Создание первого ИТ-кооператива в России - Станислав Новиков
Создание первого ИТ-кооператива в России - Станислав НовиковСоздание первого ИТ-кооператива в России - Станислав Новиков
Создание первого ИТ-кооператива в России - Станислав Новиков
 
Открытые данные, как инструмент создания собственных коммерческих приложений ...
Открытые данные, как инструмент создания собственных коммерческих приложений ...Открытые данные, как инструмент создания собственных коммерческих приложений ...
Открытые данные, как инструмент создания собственных коммерческих приложений ...
 
Freelancers Unite! - Martin Mayer
Freelancers Unite! - Martin MayerFreelancers Unite! - Martin Mayer
Freelancers Unite! - Martin Mayer
 
Облачные технологии, которые упрощают жизнь разработчикам - Игорь Лукянов
Облачные технологии, которые упрощают жизнь разработчикам - Игорь ЛукяновОблачные технологии, которые упрощают жизнь разработчикам - Игорь Лукянов
Облачные технологии, которые упрощают жизнь разработчикам - Игорь Лукянов
 
Направление: Вектор - Евгений Юртаев
Направление: Вектор - Евгений ЮртаевНаправление: Вектор - Евгений Юртаев
Направление: Вектор - Евгений Юртаев
 
Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...
 Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе... Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...
Хуки, токены, рулсы, плагины - пишем "правильный" код под Друпал - Андрей Бе...
 
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...
Continuous integration сайтов на Drupal: Jenkins, Bitbucket, Features, Drush ...
 
Создание каталога на D7 и фасетный поиск по нему - Андрей Токмаков
Создание каталога на D7 и фасетный поиск по нему - Андрей ТокмаковСоздание каталога на D7 и фасетный поиск по нему - Андрей Токмаков
Создание каталога на D7 и фасетный поиск по нему - Андрей Токмаков
 
jocurididactice
jocurididacticejocurididactice
jocurididactice
 
Drupal в облаке - Владимир Юнев
Drupal в облаке - Владимир ЮневDrupal в облаке - Владимир Юнев
Drupal в облаке - Владимир Юнев
 
От фрилансера до веб-студии за 5 шагов - Геннадий Колтун
От фрилансера до веб-студии за 5 шагов - Геннадий КолтунОт фрилансера до веб-студии за 5 шагов - Геннадий Колтун
От фрилансера до веб-студии за 5 шагов - Геннадий Колтун
 
lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...
 lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p... lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...
lucrare-problematic-a-copiilor-ramasi-singuri-acasa-ca-urmare-a-parintilor-p...
 
Опыт Drupal разработчика на бирже oDesk - Петр Лозовицкий
Опыт Drupal разработчика на бирже oDesk - Петр ЛозовицкийОпыт Drupal разработчика на бирже oDesk - Петр Лозовицкий
Опыт Drupal разработчика на бирже oDesk - Петр Лозовицкий
 
Quality Control Tests for Herbal Drugs
Quality Control Tests for Herbal DrugsQuality Control Tests for Herbal Drugs
Quality Control Tests for Herbal Drugs
 
Efficacy and Potency of drug
Efficacy and Potency of drugEfficacy and Potency of drug
Efficacy and Potency of drug
 

Semelhante a Drupal in aerospace - selling geodetic satellite data with Commerce - Martin Mayer

Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupalCampDN
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosDivante
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 
(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?RST Software Masters
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»e-Legion
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxMichelangelo van Dam
 
Data20161007
Data20161007Data20161007
Data20161007capegmail
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery ApplicationsRebecca Murphey
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxDatabricks
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2Javier Eguiluz
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitPeter Wilcsinszky
 

Semelhante a Drupal in aerospace - selling geodetic satellite data with Commerce - Martin Mayer (20)

Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin Mayer
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency Injection
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Data20161007
Data20161007Data20161007
Data20161007
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony Fox
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Growing up with Magento
Growing up with MagentoGrowing up with Magento
Growing up with Magento
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Drupal in aerospace - selling geodetic satellite data with Commerce - Martin Mayer

  • 2. A Game Changer for the Geospatial Data Market Dauria Aerospace develops new ways in building low cost satellites, thus reducing costs for earth observation data drastically. Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 3. The Game Changer for the Geospatial Data Market Affordable Geo data allow small businesses to pioneer new business models. Example: Low cost parcel monitoring service for local farmers Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 4. Building Satellites with Smartphone Technology Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 5. Building Lightweight Satellites Conventional Satellite New Satellite Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 6. Less Expensive Launches Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 7. We need a Configurable Product with a Map Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 8. Commerce's Standard Handling of Product Variations http://demo.commerceguys.com/ck/tops/guy-short-sleeve-tee Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 9. The Customizable Products Module As the ancient Drupal Proverb goes: There's a module for that Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 10. Configuration of References Content Type for the Product Display Configuration: Add Product Reference Set „Product Types that can be referenced“ to Product Type; Set „Add to Cart Line Item Type“ to Line Item Type Product Display Node Configuration: Set „Product Reference“ to Product Product Type Configuration: Set „Default Reference“ to Content Type Product Configuration: Set „Referenced by“ to Product Display Node Line Item Type Configuration: Set „Add to Cart Line Item Type“ to itself (self reference!) Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 11. Validating User Inputs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 12. Validating User Inputs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 13. Validating User Inputs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 14. Validating User Inputs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 15. Validating User Inputs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 16. Utilizing PostGIS PostGIS extends PostgreSQL Databases with geodetic functions Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 17. The PostGIS Module integrates this Functions into Drupal class PostgisGeometry { ... function validate() { $geo = is_null($this->wkt) ? $this->geometry : $this->wkt; try { $result = db_query("SELECT ST_GeometryType(:geo), ST_IsValid(:geo), ST_IsValidReason(:geo) as reason", array(':geo' => $geo))->fetchAssoc(); // Return reason if geometry is not valid. if (!$result['st_isvalid']) { return array( 'error' => 'postgis_unparsable', 'message' => t('Not a valid geometry: @reason.', array('@reason' => $result['reason'])), ); } Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org ... } catch (PDOException $e) { // TODO: catch only WKT parse errors. return array( 'error' => 'postgis_unparsable', 'message' => t('Unable to parse WKT: ' . $geo), ); } }
  • 18. But the PostGIS Module has some Weaknesses /** * Calculates diffrence to a given geometry. * * @param PostgisGeometry $geometry * Geometry which this instance will be compared to. * * @return PostgisGeometry * Geometry of diffrence. */ function diff($geometry) { ... $geo_diff = db_query("SELECT ST_Union(ST_Difference(:geo_a, :geo_b), ST_Difference(:geo_b, :geo_a))", array(':geo_a' => $geo_a, ':geo_b' => $geo_b))->fetchField(); $geo_type = db_query("SELECT GeometryType(:geo_diff)", array(':geo_diff' => $geo_diff))->fetchField(); $diff = new PostgisGeometry($geo_type, $this->srid); $diff->fromGeometry($geo_diff); return $diff; Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org } - Some important geodetic functions are not implemented - Error handling is inconsistent
  • 19. Extending and Overwriting the PostGIS Module class PostgisGeometries extends PostgisGeometry { ... function intersects($geometry) { if ((get_class($geometry) !== 'postgis_geometry') && (get_class($geometry) !== 'PostgisGeometries')) { throw new PostgisGeometryException('not postgis_geometry'); } try { $geo_a = $this->getText(); if(stripos($geo_a,'GEOMETRYCOLLECTION(' ) === 0) { $geo_a = substr(strstr($geo_a, '('),1, -1); } $geo_b = $geometry->getText(); if(stripos($geo_b,'GEOMETRYCOLLECTION(' ) === 0) { $geo_b = substr(strstr($geo_b, '('),1, -1); } $intersects = db_query("SELECT ST_Intersects(text :geo_a, text :geo_b)", array(':geo_a' => $geo_a, ':geo_b' => $geo_b))->fetchField(); return $intersects; } catch (PDOException $e) { throw new PostgisGeometryException( $e->getMessage( ) , (int)$e->getCode( ) ); Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org } }
  • 20. Writing a module to validate the AOI and calculate the price function water_quality_form_alter(&$form, &$form_state, $form_id) { ... $form['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']['#element_validate'][] = 'water_quality_aoi_validate'; ... function water_quality_aoi_validate($element, &$form_state) { ... $coverage_region_comparison->transform($aoi->getSrid()); $coverage_region_comparison->dump(); $intersects_google_projection = $coverage_region_comparison->intersects($aoi_comparison); if ($intersects_google_projection){ // Convert aoi to srid of the region. $aoi_comparison->transform($coverage_region['region']->getSrid()); $aoi_comparison->dump(); // check if the aoi intersects with the region. This needs to be // done in the SRID of the coverage region for accuracy. $within = $aoi_comparison->within($coverage_region['region']); if ($within){ Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org ... ...
  • 21. The Open Layers Editor has some Bugs What it should deliver POLYGON((1066993.16984217 4873953.49407963, 1340943.47921804 5392502.29411237, 1810572.58092165 5382718.35450175, 1979345.539345157 5106322.0602720035, 1849708.33939679 4776114.09813913, 1066993.16984217 4873953.49407963)) GEOMETRYCOLLECTION( POLYGON((1066993.16984217 4873953.49407963, 1340943.47921804 5392502.29411237, 1810572.58092165 5382718.35450175, 1979345.539345157 5106322.0602720035, 1849708.33939679 4776114.09813913, 1066993.16984217 4873953.49407963)), POINT(1203968.324530105 5133227.894096), POINT(1575758.0300698448 5387610.32430706), POINT(1894959.0601334036 5244520.207386877), POINT(1914526.9393709735 4941218.079205567), POINT(1458350.75461948 4825033.79610938), POINT(1066993.16984217 4873953.49407963), POINT(1340943.47921804 5392502.29411237), POINT(1810572.58092165 5382718.35450175), POINT(1979345.539345157 5106322.0602720035), POINT(1849708.33939679 4776114.09813913)) What it sometimes delivers GEOMETRYCOLLECTION() Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 22. The Open Layers Editor has some Bugs Caching and the Open Layers Editor have an awkward relationship Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 23. The Open Layers Editor has some Bugs function water_quality_form_alter(&$form, &$form_state, $form_id) { ... ... function water_quality_subscription_type_validate($element, &$form_state) { if(!isset($element['#value']) || empty($element['#value'])){ drupal_rebuild_form($form_state['build_info']['form_id'], $form_state); } Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org } function eomap_eula_validate($element, &$form_state) { if(!isset($element['#value']) || empty($element['#value'])){ drupal_rebuild_form($form_state['build_info']['form_id'], $form_state); form_set_error('field_line_item_map', t('Agreement to Product EULA must be checked')); } } $form['line_item_fields']['field_subscription_type'][LANGUAGE_NONE]['#element_validate'][] = 'water_quality_subscription_type_validate'; $form['line_item_fields']['field_eomap_eula_agreement'][LANGUAGE_NONE]['#element_validate'][] = 'eomap_eula_validate'; ... ... }
  • 24. The Open Layers Editor has some Bugs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 25. The Open Layers Editor has some Bugs Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 26. The Open Layers Editor has some Bugs $form_state['no_cache'] = TRUE; if (isset($form_state['values']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'])){ $form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'] = $form_state['values']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']; } else { if (isset($form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt'])){ $wkt = $form_state['input']['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']; if(stripos($wkt, 'POINT') !== false){ $wkt = substr(strstr($wkt, '('), 1,(stripos($wkt, ',POINT') - stripos($wkt, '(') -1)); } $form['line_item_fields']['field_line_item_map'][LANGUAGE_NONE][0]['wkt']['#value'] = $wkt; Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org } } Some form fields mysteriously loose their value and need to be refilled
  • 27. Wrapping it up: Placing the Geo Data Product in the Shopping Cart A Rule overwrites the line item price with the calculated price Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 28. Wrapping it up: Placing the Geo Data Product in the Shopping Cart Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 29. What it's all about... You can build some such thing and even more sophisticated sites with Drupal modules and a little coding! Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 30. Any Questions? Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org
  • 31. The End Спасибо за внимание Спасибі за увагу Danke für Ihre Aufmerksamkeit Thank you for your attention Translated to a select choice of languages of planet Earth: Martin Mayer, Diplom Systems Practitioner (Open) info@socialoom.org