Coordinate Reference System not Recognized in gvNIX - gvnix

In reference to this post I am trying to create a map based web application using gvNIX to hold location data on health faciilities. Am following this tutorial as a guide. When issuing the command:
web mvc geo controller --class ~.web.MapViewerController --preferredMapping Tanzania --projection EPSG4210
I get the error:
java.lang.IllegalArgumentException: Failed to convert 'EPSG4210' to type ProjectionCRSTypes for option 'projection'
No enum constant org.gvnix.addon.geo.addon.ProjectionCRSTypes.EPSG4210
Am new to GIS and am assuming that EPSG4210 is the correct Coordinate Referencing System for Tanzania? How may I overcome this error?
Kind regards,
T

This projection is not included on gvNIX, so it can't handle it by default.
To use this projection you must follow this steps:
Create the view using a register projection (4326 by example)
Modify show.jspx to use your projection (EPSG4210)
Register this projection in proj4leaflet-custom-proj.js file (there you can find an example which defines EPSG:25830) (see leaflet plugin project)
Good luck!

Related

How to rewrite the table qualifier at runtime with JOOQ

When generating code using JOOQ for a SQL Server database the generation creates three-part qualifiers like: [catalog].[schema].[table]. This is exactly what I want when working with the SQL Server databases but is an issue when using the generated code with another database like an H2 in memory database for unit testing.
The H2 dialect does not support these three-part qualifiers, H2 expects something like [catalog].[table]. This causes syntax errors when executing commands like the following against H2:
context.createTable(TBLBUSINESSENTITY).columns(TBLBUSINESSENTITY.fields()).execute();
To solve this I need to change the qualifier at runtime which I thought could be done using a render mapping and mapped schema. Unfortunately, this seems to only have the ability to modify the schema portion of the qualifier like this:
Settings settings = new Settings().withRenderMapping(new RenderMapping().withSchemata(
new MappedSchema().withInput("dbo").withOutput("mySchema")));
Given the qualifier [MyDatabase].[dbo].[MyTable], this maps to [MyDatabase].[mySchema].[MyTable] but I cant figure out how to remove that section entirely.
Is there some way to rewrite the mapping to [MyDatabase].[MyTable]?
Use this setting instead:
Settings settings = new Settings()
.withRenderCatalog(false)
.withRenderMapping(new RenderMapping()
.withCatalogs(new MappedCatalog()
.withInput("MyDatabase")
.withSchemata(new MappedSchema()
.withInput("dbo")
.withOutput("MyDatabase"))));

What is the difference between Override Attribute Initializers and Set Run State in Enterprise Architect and why does it behave differently?

this is my first question on SO, so please exercise some kindness on my path to phrasing perfect questions.
On my current project I try to model deployments in EA v14.0 where I want components to be deployed on execution environments and additionally set them to some values.
However depending on how I deploy (as an Deployment Artifact or as a Component Instance) I get different behaviours. On Deployment Artifacts I am offered to Override Attribute Initializers. On a Component Instance I am offered to Set Run State. When I try to set an attribute on the DeploymentArtifact I get an error message that there is no initialiser to override. When I try to set the run state on the Component Instance I can set a value. However, then I get an UML validation error message, that I must not link a component instance to an execution environment:
MVR050002 - error ( (Deployment)): Deployment is not legal for Instance: Component1 --> ExecutionEnvironment1
This is how I started. I created a component with a deployment specification:
I then created a deployment diagram to deploy my component: Once as a Deployment Artifact and once as a Component Instance.
When I try to Override Attribute Initializers , I get the error message DeploymentArtifact has no attribute initializers to override`.
When I try to Set Run State I can actually enter values .
However, when I then validate my package, I get the aforementioned error message.
Can anyone explain what I am doing wrong or how this is supposed to work?
Thank you very much for your help!
Actually there are multiple questions here.
Your 2nd diagram is invalid (and probably EA should have moaned here already since it does so in V12).
You can deploy an artifact on a node instance and use a deployment spec as association class like shown on p. 654 of the UML 2.5 specs:
But you can not deploy something on something abstract. You will need instances - on both sides.
You can silence EA about warnings by turning off strict connector checking in the options:
To answer your question in the title: Override initializers looks into the attribute list of the classifier of an object and offers the so you can set any run states (that is values of attributes at runtime). Moreover the Set Run State allows to set arbitrary key value pairs which are not classifier attributes. This is to express e.g. RAM size in Nodes or things like that.

AutoMapper inline mapping throwing mapper not initialized

I'm trying to use AutoMapper in a API wrapper class library project to map from API models to our domain models. While looking at the AutoMapper documentation I ran into the inline mapping feature.
Documentation says:
AutoMapper creates type maps on the fly (new in 6.2.0). When you call Mapper.Map for the first time, AutoMapper will create the type map configuration and compile the mapping plan. Subsequent mapping calls will use the compiled map.
So I wrote the following line of code in my wrapper class library:
var data = response.Results.Select(Mapper.Map<Session, Media>).ToList();
basically just trying to map the Session object I get from the API into our Media objects. But this throws the following error:
Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
I was under the impression that inline mapping is exactly supposed to bypass having to initialize and define configuration for AutoMapper? Am I wrong?
Also if I am indeed wrong then how are you supposed to configure and initialize AutoMapper inside a class library to where it happens only once? I would like the library to be independent, meaning I don't want the programmer using the library to have to configure AutoMapper in his project in order for the library to work properly.

Why does JHipster page not accept String for ZonedDateTime

I recently changed my domain objects from LocalDate to ZonedDateTime. I also created a brand new play JHipster application and one play entity choosing ZonedDateTime for two class members. The test application (new) works while my existing application does not, even after going through all the code twice. I loaded CSV data using Liquibase and my listing code shows the dates properly. Here's what the data looks like in my Maven output, e.g. entrydate='2017-02-23T19:53:18-05:00[America/New_York]', transaction='Initial Balance',
When I choose to update the date-time value with the "datetime-picker" in the dialog.html, a string date time is shown in the text box but when I push "Save" I get an "Internal Server Error" and the Maven output shows:
.HttpMessageNotReadableException: Could not read document: Text '2017-02- 26T00:53:18.000Z' could not be parsed at index 23 (through reference chain: org.ciwise.blackhole.domain.GenLedger["entrydate"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Text '2017-02-26T00:53:18.000Z' could not be parsed at index 23 (through reference chain: org.ciwise.blackhole.domain.GenLedger["entrydate"])]
Does anyone have an idea why the picker would produce String text in the text box that isn't acceptable when the HTTP PUT occurs (edit)?
My application does use Service classes but they handle the same Java domain objects as the JPA Repository classes do.
One more thing, the schema for the API shows e.g. "entrydate": "2017-02-23T21:44:04.859Z", but the actual JSON return is "entrydate": "2017-02-23T19:53:18.000-0500",
I'm hoping someone else has encountered this before.
Thanks
David
The answer here was to re-introduce application.yml. Inside this file it defines some Spring profiles but of most importance, it provides an option for Jackson serialization into JSON e.g.
jackson:
serialization.write_dates_as_timestamps: false
This resolved my issue.

Core Data declared remove<key>ItemsAtIndex method results in unrecognized selector

I have a Core Data "List" entity that has an ordered relationship to ListItems.
Core Data itself, generates a method in the .h,
- (void)removeListItemsAtIndexes:(NSIndexSet *)indexes;
However, when I attempt to invoke that method, at runtime the app crashes stating its an unrecognized selector.
Is this method really not implemented? Why would Core Data declare it if its not implemented? Am I supposed to do something else to make this work?
Thanks
You should look at this post:
problems-with-nsorderedset
it's lion app, but i think the problem is same.

Resources