MapFish:print Styling not applying - mapfish

I'm trying to build a MapFish Style that i can apply to mixed Well known text types
example feature
{
"geometry": {
"type": "LineString",
"coordinates": [...],
"properties": {
"Name": "KN",
"id": "5a002a8e9ee4e84a3c125067",
"geoType": "LineString",
...
},
"profile":{...}
"type": "Feature"
},
and i am applying this style
{
"version": "2",
"[geoType IN ('LineString', 'MultiLineString', 'Curve', 'MultiCurve', 'CompoundCurve')]": {
"symbolizers": [{
"type": "Line",
"strokeColor": "#000080",
"strokeOpacity": "0.65",
"strokeWidth": "5.0"
}]
},
"[geoType IN ('Polygon', 'MultiPolygon', 'Triangle', 'CircularString', 'CurvePolygon')]": {
"symbolizers": [{
"type": "Line",
"strokeColor": "#000080",
"strokeOpacity": "0.65",
"strokeWidth": "5.0"
}, {
"type": "polygon",
"strokeColor": "#000080",
"strokeOpacity": "0.65",
"strokeWidth": "5.0",
"fillColor": "#000080",
"fillOpacity": "0.65"
}]
},
"[geoType IN ('Point', 'MultiPoint')]": {
"symbolizers": [{
"type": "point",
"pointRadius": "20",
"graphicName": "circle",
"graphicWidth": "20",
"strokeColor": "#000080",
"strokeOpacity": "0.65",
"strokeWidth": "5.0",
"fillColor": "#000080",
"fillOpacity": "0.65"
}]
}
}
it is throwing no error and the print completed but when i get nothing from the GeoJSON
any pointers on what I've got wrong?

The issue is the Profile attribute, not sure why but if your GeoJson has any extra properties in the root of the node mapfish wont process it

Related

Deneb Waffle chart (percentual share) displays correctly in PBI desktop however shows as blank in PBI Service

could anyone please help with my issue? I´ve created couple of DENEB visuals which seem to be working fine both in PBI Desktop and service however the one I´m sharing doesn´t work in PBI service, it shows as blank.
Do you know by chance what might be the problem?
Here is the JSON that I´m using:
{
"data": {"name": "dataset"},
"transform": [
{
"joinaggregate": [
{
"op": "sum",
"field": "NrOfSfhifts",
"as": "TotalOrigin"
}
]
},
{
"joinaggregate": [
{
"op": "sum",
"field": "NrOfSfhifts",
"as": "TotalOriginGrouped"
}
],
"groupby": ["NrOfSfhifts"]
},
{
"calculate": "round(datum.TotalOriginGrouped/datum.TotalOrigin * 100)",
"as": "PercentOfTotal"
},
{
"aggregate": [
{
"op": "average",
"field": "PercentOfTotal",
"as": "Percento"
}
],
"groupby": ["Dispatcher"]
},
{
"calculate": "sequence(1,datum.Percento+1)",
"as": "S"
},
{"flatten": ["S"]},
{
"window": [
{"op": "row_number", "as": "id"}
],
"sort": [
{
"op": "sum",
"field": "TotalOriginGrouped",
"order": "ascending"
}
]
},
{
"calculate": "ceil (datum.id / 10)",
"as": "row"
},
{
"calculate": "datum.id - datum.row * 10",
"as": "col"
}
],
"mark": {
"type": "circle",
"filled": true,
"tooltip": true,
"stroke": "black",
"strokeWidth": 2
},
"encoding": {
"x": {
"field": "col",
"type": "ordinal",
"axis": null,
"sort": "x"
},
"y": {
"field": "row",
"type": "ordinal",
"axis": null,
"sort": "y"
},
"color": {
"field": "Dispatcher",
"type": "nominal",
"sort": [
{
"op": "sum",
"field": "TotalOriginGrouped",
"order": "descending"
}
],
"scale": {
"range": [
"#FFD300",
"#ed3419",
"lightgray",
"white",
"black",
"olive",
"lightblue"
]
},
"legend": {
"orient": "right",
"offset": 10,
"labelOffset": 3,
"titlePadding": 5,
"titleFontSize": 10
}
},
"size": {"value": 330},
"tooltip": [
{
"field": "Dispatcher",
"type": "nominal"
},
{
"field": "Percento",
"type": "quantitative",
"format": "0",
"formatType": "pbiFormat"
}
]
}
}
Thank you!
That is my code :).
If this is working in the desktop but not the service, then your admin has probably disabled non-native visuals. You should ask them to enable certified visuals at the very least as there is no danger from those.

Power BI - Deneb chart showing tooltips in reverse

I've created a simple stacked bar chart in Deneb where the user can highlight in place: x-axis is group, highlight is tiers. I've also created a tooltip that should show the name for each bar and should match the label on the bar. What's strange is that the tooltip shows in reverse order: pointing to A shows D, F shows E, etc. (See this pbix file.) I've attempted to insert sorting to the bars; that didn't work. My preference is to have the bars remain as they are and the tooltips show to match; however, it would be ok (less desirable) to reverse the order of the bars. How can I get the tooltip to match the label?
This cleaned up spec works.
Don't forget to accept the answer if this solves your problem.
{
"data": {"name": "dataset"},
"transform": [
{
"stack": "test2",
"as": ["a", "b"],
"groupby": ["group"]
}
],
"layer": [
{
"mark": {
"type": "bar",
"stroke": "black",
"strokeWidth": 1,
"opacity": 0.3
},
"encoding": {
"color": {
"field": "group",
"type": "nominal",
"scale": {
"domain": [
"Low",
"Med",
"High"
],
"range": [
"#e15759",
"#ffff00",
"#59a14f"
]
},
"legend": null
}
}
},
{
"mark": {
"type": "bar",
"stroke": "black",
"strokeWidth": 1,
"tooltip": true
},
"encoding": {
"color": {
"field": "group",
"type": "nominal",
"scale": {
"domain": [
"Low",
"Med",
"High"
],
"range": [
"#e15759",
"#ffff00",
"#59a14f"
]
},
"legend": null
},
"opacity": {
"condition": {
"test": "datum['test2__highlight']!=null",
"value": 1
},
"value": 0
}
}
},
{
"mark": {
"type": "text",
"color": "black",
"dy": -90
},
"encoding": {
"text": {"field": "name"}
}
}
],
"encoding": {
"y": {
"field": "a",
"type": "quantitative",
"axis": {
"title": "Number of Projects",
"tickMinStep": 1
}
},
"y2": {"field": "b"},
"x": {
"field": "group",
"type": "nominal",
"axis": {
"title": null,
"labelAngle": 0
}
}
}
}

AWS API Gateway fails to import Swagger definition: Unsupported model type 'MapProperty'

I am currently on this screen trying to import my app's swagger definition so I can create an API Gateway instance.
Unfortunately, you can see I'm getting some errors - even though swagger seems to think it's entirely fine.
Your API was not imported due to errors in the Swagger file.
Unable to create model for 200 response to method 'GET /api/v1/courses': Validation Result: warnings : [], errors : [Invalid content type specified: */*]
Unsupported model type 'MapProperty' in 200 response to method 'GET /api/v1/courses/all'. Ignoring.
Here is my swagger definition:
{
"swagger": "2.0",
"info": {
"description": "Api Documentation",
"version": "1.0",
"title": "Api Documentation",
"termsOfService": "urn:tos",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"host": "********.appspot.com",
"basePath": "/",
"tags": [{
"name": "course-controller",
"description": "Course Controller"
}],
"paths": {
"/api/v1/courses": {
"get": {
"tags": ["course-controller"],
"summary": "getCourses",
"operationId": "getCoursesUsingGET",
"produces": ["*/*"],
"parameters": [{
"name": "code",
"in": "query",
"description": "code",
"required": false,
"type": "string"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Course"
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
},
"/api/v1/courses/all": {
"get": {
"tags": ["course-controller"],
"summary": "getAllCourses",
"operationId": "getAllCoursesUsingGET",
"produces": ["*/*"],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
}
},
"definitions": {
"Course": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"credits": {
"type": "integer",
"format": "int32"
},
"id": {
"type": "integer",
"format": "int32"
},
"lastUpdated": {
"type": "string"
},
"name": {
"type": "string"
},
"prerequisites": {
"type": "string"
},
"restrictions": {
"type": "string"
},
"seats": {
"$ref": "#/definitions/Seats"
},
"waitlist": {
"$ref": "#/definitions/Seats"
}
},
"title": "Course"
},
"Seats": {
"type": "object",
"properties": {
"actual": {
"type": "integer",
"format": "int32"
},
"capacity": {
"type": "integer",
"format": "int32"
},
"remaining": {
"type": "integer",
"format": "int32"
}
},
"title": "Seats"
}
}
}
Is there any reason you can find for this swagger definition breaking in API Gateway?
AWS API Gateway has some limitations in its OpenAPI support. For example, it does not support additionalProperties in models (this keyword is used in the 200 response schema for the /api/v1/courses/all endpoint in your API).
You can click the "Import and ignore warnings" button to ignore those errors and proceed with the import.

Loopback hasManyThrough relation for user

I have such models:
Team
{
"name": "Team",
"plural": "teams",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"mixins": {
"ModelRest": {}
},
"hidden": [
"deleted"
],
"filtered": [
"userId",
"archived"
],
"properties": {
"name": {
"type": "string",
"required": true
},
"createdAt": {
"type": "date"
},
"deleted": {
"type": "boolean"
}
},
"validations": [],
"relations": {
"projects": {
"type": "hasMany",
"model": "Project"
},
"user": {
"type": "belongsTo",
"model": "user"
},
"users": {
"type": "hasMany",
"model": "User",
"foreignKey": "",
"through": "TeamMember"
}
},
"acls": [],
"methods": {}
}
TeamMember
{
"name": "TeamMember",
"plural": "team-members",
"base": "Model",
"idInjection": false,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
"relations": {
"user": {
"type": "belongsTo",
"model": "user"
},
"team": {
"type": "belongsTo",
"model": "Team"
}
},
"acls": [],
"methods": {}
}
user
{
"name": "user",
"plural": "users",
"base": "User",
"idInjection": true,
"mixins": {
"ModelRest": {}
},
"hidden": [
"realm",
"emailVerified",
"lastIP",
"deleted",
"utmSource",
"utmMedium",
"utmCampaign"
],
"readOnly": [
"statusId",
"lastListId",
"teamId",
"subscriptionStart",
"subscriptionExpiration",
"apiKey"
],
"properties": {
"name": {
"type": "string",
"required": true,
"mysql": {
"columnName": "username"
}
},
"password": {
"type": "string",
"required": true,
"min": 5
},
"email": {
"type": "string",
"required": true
},
"createdAt": {
"type": "date"
},
"updatedAt": {
"type": "date"
},
"subscriptionStart": {
"type": "date"
},
"subscriptionExpiration": {
"type": "date"
},
"teamId": {
"type": "number"
},
"sharePlan": {
"type": "boolean"
},
"shareLeads": {
"type": "boolean"
},
"timezone": {
"type": "string"
},
"utmSource": {
"type": "string"
},
"utmMedium": {
"type": "string"
},
"utmCampaign": {
"type": "string"
},
"lastIP": {
"type": "string"
},
"deleted": {
"type": "boolean"
}
},
"validations": [],
"relations": {
"team": {
"type": "belongsTo",
"model": "Team"
},
"plan": {
"type": "belongsTo",
"model": "Plan"
},
"billingCycle": {
"type": "belongsTo",
"model": "BillingCycle"
},
"card": {
"type": "belongsTo",
"model": "Card"
},
"lastList": {
"type": "belongsTo",
"model": "List"
},
"status": {
"type": "belongsTo",
"model": "Status"
},
"accessTokens": {
"type": "hasMany",
"model": "AccessToken"
}
},
"acls": [],
"methods": {}
}
I've created relation in Team model:
"users": {
"type": "hasMany",
"model": "User",
"foreignKey": "",
"through": "TeamMember"
}
But users relation in Team doesn't work at all. In API explorer I see
GET /teams/{id}/user
there is no
GET /teams/{id}/users
Why does this happen?
I've even created this relation with Loopback relation generator. Same result. Can't figure out where is the error. Loopback doest see this relation.
Thanks for any help.
It's all, because in model-config.json I have
"TeamMember": {
"dataSource": null,
"public": true
},
instead of:
"TeamMember": {
"dataSource": "db",
"public": true
},

CouchDB-Why my rerduce is always coming as false ? I am not able to reduce anything properly

I am new to CouchDB. I have a 9 gb dataset loaded into my couchdb. I am able to map everything correctly. But I cannot reduce any of the results using the code written in the reduce column. When i tried log, log shows that rereduce values as false. Do i need to do anything special while doing the Map() or how to set the rereduce value is TRUE??
A sample of my data is as follows:
{
"_id": "33d4d945613344f13a3ee92933b160bf",
"_rev": "1-0425ca93e3aa939dff46dd51c3ab86f2",
"release": {
"genres": {
"genre": "Electronic"
},
"status": "Accepted",
"videos": {
"video": [
{
"title": "[1995] bola - krak jakomo",
"duration": 349,
"description": "[1995] bola - krak jakomo",
"src": "http://www.youtube.com/watch?v=KrELXoYThpI",
"embed": true
},
{
"title": "Bola - Forcasa 3",
"duration": 325,
"description": "Bola - Forcasa 3",
"src": "http://www.youtube.com/watch?v=Lz9itUo5xtc",
"embed": true
},
{
"title": "Bola (Darrell Fitton) - Metalurg (MV)",
"duration": 439,
"description": "Bola (Darrell Fitton) - Metalurg (MV)",
"src": "http://www.youtube.com/watch?v=_MYpOOMRAeQ",
"embed": true
}
]
},
"labels": {
"label": {
"catno": "SKA005",
"name": "Skam"
}
},
"companies": "",
"styles": {
"style": [
"Downtempo",
"Experimental",
"Ambient"
]
},
"formats": {
"format": {
"text": "",
"name": "Vinyl",
"qty": 1,
"descriptions": {
"description": [
"12\"",
"Limited Edition",
"33 ⅓ RPM"
]
}
}
},
"country": "UK",
"id": 1928,
"released": "1995-00-00",
"artists": {
"artist": {
"id": 390,
"anv": "",
"name": "Bola",
"role": "",
"tracks": "",
"join": ""
}
},
"title": 1,
"master_id": 13562,
"tracklist": {
"track": [
{
"position": "A1",
"duration": "4:33",
"title": "Forcasa 3"
},
{
"position": "A2",
"duration": "5:48",
"title": "Krak Jakomo"
},
{
"position": "B1",
"duration": "7:50",
"title": "Metalurg 2"
},
{
"position": "B2",
"duration": "6:40",
"title": "Balloom"
}
]
},
"data_quality": "Correct",
"extraartists": {
"artist": {
"id": 388200,
"anv": "",
"name": "Paul Solomons",
"role": "Mastered By",
"tracks": "",
"join": ""
}
},
"notes": "Limited to 480 copies.\nA1 is a shorter version than that found on the 'Soup' LP.\nA2 ends in a lock groove."
}
}
My intention is to count the mapped values. My mapping function is as follows:
function(doc){
if(doc.release)
emit(doc.release.title,1)
}
Map results shows around 5800 results
I want to use the following functions in the reduce tab to count:
Reduce:
_count or _sum
It does not give single rounded value. Even i cannot get the simple _count operations right !!! :(
for screenshot,
Please help me !!!
What you got was the sum of values per title. What you wanted, was the sum of values in general.
Change the grouping drop-down list to none.
Check CouchdDB's wiki for more details on grouping.