I'm trying to load all points of sertain layer from OpenStreetMap. But I can't find such command in overpass api. Is this even possible?
All that I can achieve is all nodes from certain bounding box:
<osm-script output="json">
<query type="way">
<bbox-query {{bbox}}/>
</query>
<recurse type="way-node" into="waynodes"/>
<query type="node" into="nodes">
<bbox-query {{bbox}}/>
</query>
<!-- added by auto repair -->
<union>
<item/>
<recurse type="down"/>
</union>
<!-- end of auto repair -->
<print/>
</osm-script>
OpenStreetMap doesn't have a "layer" concept in contrast to other GIS data.
For loading all existing information you simply have to query for every element type, i.e. nodes, ways and relations. That's all. overpass turbo (a nice web frontend for the Overpass API) already does this by default when using the wizard.
Related
GET Service for listing Buckets
With the tutorial in the link above, I am able to list Buckets in my account. However, the response only return 1000 Buckets which I believe is the limit for a single response. The problem is how can I list the remaining Buckets in my account? For listing Bucket Objects, we can add the marker param to indicate from which object to continue listing but it seems there is no such param for listing Buckets.
Edit:
I am using HMAC keys instead of OAuth2 to make request so I cannot use the JSON API, "HMAC keys can only be used to make requests to the XML API, not the JSON API", according to HMAC keys Restrictions
Current XML response which doesn't include anything like marker, cursor or pageToken:
<?xml version='1.0' encoding='UTF-8'?>
<ListAllMyBucketsResult
xmlns='http://doc.s3.amazonaws.com/2006-03-01'>
<Buckets>
<Bucket>
<Name>bucket-1</Name>
<CreationDate>2019-09-23T07:03:11.892Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket-2</Name>
<CreationDate>2019-09-23T07:03:12.578Z</CreationDate>
</Bucket>
...
<Bucket>
<Name>bucket-999</Name>
<CreationDate>2019-09-23T07:03:11.892Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket-1000</Name>
<CreationDate>2019-09-23T07:03:12.578Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>
You could try using the JSON API's list method. With this method whenever your results are over the maximum a pageToken item will be returned, you can use it as a parameter for your next request in order to paginate through the results.
Before implementing it you can test this API from the documentation page.
I am trying to figure out if it is possible with the OverpassAPI to download all boundary data for a country.
Small example: Luxembourg
I would like to get all relations that are tagged as (key-value) boundary=administrative. I would like to receive all ways to these relations, and all nodes in these ways.
I assume that could be quite a lot of data (?) so I wonder if one query is the way to go, especially if I would try to do it with Germany or France (with about 20 items on admin_level=4, and hundreds on admin_level=6 or 8)
This is further complicated because the bounding box around the country takes in all other countries sharing a border with the one "in-box".
So this seems not to be the way - what technique would I use to get all nodes on all ways that form administrative boundaries of a country?
What I am currently trying is this
<osm-script>
<query type="relation">
<bbox-query s="49" w="2" n="52" e="7"/>
<has-kv k="boundary" v="administrative"/>
<has-kv k="admin_level" v="2"/>
</query>
<print mode="meta"/>
</osm-script>
This is a bounding box for Belgium (say mid-size), and restricted to admin_level=2. Also, this does not yet deliver node information.
I know how to change that - but this will deliver all neighbouring countries too. What is a better way of doing this?
Thanks!
Ralf
I would recommend to look at OSM Boundaries map instead, a dedicated application for worldwide boundary on just about any level you can think of: https://wambachers-osm.website/boundaries
In any case, there's quite some load on the main overpass api instance and it is likely that you will hit a HTTP 429 error when running the following query to fetch all ways and nodes for Germany:
(rel(51477);>;);out meta;
or:
(rel[boundary=administrative][admin_level=2][name="Deutschland"];>;);out meta;
To get all boundary=administrative relations with all of their ways and nodes in Luxemburg, the following query should do (careful: returns 47 MB of data, including Germany, Rhineland-Palatine and Saarland).
rel(2171347);
map_to_area;
(rel[boundary=administrative](area);>;);
out meta;
Maybe try this alternative as well.
I need to fetch data of CATENTDESCOVR using Databean.
Is there any databean provided by IBM to get the data?
I am using IBM WebSphere Commerce V7.0 Feature Pack 8
this is good question and here below is the explanation how CATENTDESCOVR works , this answer is based on WCS 7.0 , FEP 7 . but I believe fep 8 have same api , i don't think IBM enhanced this in fep8!
the information of CATENTDESCOVR are indexed and stored in solr, BUT the reason for indexing is just for searching and spellcheck, you can see how we are copying these info to defultSearch and spellCheck to make these values searchable and to be part of spellcheck (end of schema.xml).
if you look at how these data are indexed and stored in solr in schema.xml you will find following line
<!--
Catentry's description override: map to table CATENTDESCOVR
-->
<field name="nameOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
<field name="shortDescriptionOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
<field name="keywordOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
please note here the multiValued="true" , this means that if you have multible stores belongs to same Esite , the solr index the nameOvr , descOvr as multivalued for that catentryId , but solr have no idea which overridden name belongs to which store , that bean said , IBM solr index the master catalog data not store specific data .
this brings the question how the overridden name is shown per store in store front?
the answer is by utilizing WC-Search post-processor:
com.ibm.commerce.foundation.server.services.rest.search.postprocessor.solr.SolrRESTSearchCatalogEntryViewDescriptionQueryPostprocessor
if you look at the implementation of this postprocessor you will find the following high level steps :
1- get the catOvrGrpId by:
catOvrGrpId = CatalogOverrideHelper.getOverrideGroupIdForStore(this.iStoreId)
2- get the required overridden data by calling the DSL service:
JDBCQueryService service = new JDBCQueryService("com.ibm.commerce.catalog");
queryParameters.put("language", langIds);
queryParameters.put("UniqueID", catEntryUniqueIDs);
queryParameters.put("catOverrideGroupID", groupIds);
service.executeQuery("IBM_Get_CatentryDescOverride_By_LangId_And_CatentryId_And_GroupId",
queryParameters);
3- convert the array list returned to JSON compatible result:
populateOverrideCatalogEntries((List)listOfPhysicalObjects, catalogEntryViews);
you can reused the codes above and try to de-compile SolrRESTSearchCatalogEntryViewDescriptionQueryPostprocessor to understand how you can read these information from database.
the query for IBM_Get_CatentryDescOverride_By_LangId_And_CatentryId_And_GroupId is exist under Search/xml/config/com.ibm.commerce.catalog/wc-query-utilities.tpl
Hope this will be informative for you.
Thanks
Abed
The short answer is that there isn't a DataBean for accessing this data.
The [beginning of the] long answer is that you need to use the BOD+DSL layers in order to access such data.
Either through JSP using the getData tag (Aurora uses this tag extensively) or using Java code (sometimes using XPath expressions...).
You can also trace the query: see here.
However, to my understanding, the idea of overrides is that they are transparent to the front-end. I.e. the description overrides are replacing the main descriptions when they are set-up. see here
Not sure what you're trying to do with accessing this data directly. Override WCS logic?
The CATENTDESCOVR will already have been indexed in your solr core.
Look in solr\home\MC_10001\en_US\CatalogEntry\conf, for in the wc-data-config.xml, and you can see it being mapped into the core.
When you request data from solr, one of the Post processing filters defined in the wc-search.xml of the Search EAR project will fill in the override value as the "name" or "shortdesc" of the returned values.
So, you really only need to call the rest service as normal to get this value. Provided ofcourse you are wanting it from the frontend.
If you need it backend, you can use the CatalogEntryFacadeClient to perform the solr query.
One of our clients is unable to export an invoice to QuickBooks Online Harmony using the new v3 REST API. The error they get is "Business Validation Error: One or more transaction lines do not have a tax code associated with it. Please assign a tax code for those lines."
An example request and response are shown below.
I'm wondering:
Is this related to a sales tax setting that our client has set?
Which setting? (I'd like to be able to reproduce the setup on a test company)
Do we need to send additional data in the invoice add request to accommodate that setting?
For what it's worth, the client is based in Canada. Testing an invoice export with similar data for a non-Canadian company works fine. Thanks for the help.
EXAMPLE REQUEST:
<Invoice xmlns="http://schema.intuit.com/finance/v3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TxnDate>2014-03-12</TxnDate>
<PrivateNote>Some private note.</PrivateNote>
<Line>
<Description>My Description</Description>
<Amount>3333.33</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="My Description">3</ItemRef>
<ClassRef name="3">3333</ClassRef>
</SalesItemLineDetail>
</Line>
<CustomerRef name="My Customer Name">33</CustomerRef>
<ClassRef name="3">3333</ClassRef>
</Invoice>
EXAMPLE RESPONSE:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-03-13T11:47:58.052-07:00">
<Fault type="ValidationFault">
<Error code="6000" element="">
<Message>A business validation error has occurred while processing your request</Message>
<Detail>Business Validation Error: One or more transaction lines do not have a tax code associated with it. Please assign a tax code for those lines.</Detail>
</Error>
</Fault>
</IntuitResponse>
I see that you have already enabled sales tax settings. The next thing you can do is create the invoice in the UI and then load it through the API as Matt suggested. Assign some tax to the invoice and Read it using API explorer.
THis will give you an idea as to what is expected in the lines. This will definitely help you out with the correct tags you need to set.
Alternately refer to the docs with example request here-
https://developer.intuit.com/docs/api/accounting#/complex-data-types
Global tax model-
https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/global_tax_model
If you have sales tax enabled in QBO, then all line items in invoice need to have a TaxCodeRef, and there needs to be a TxnTaxDetail object on the invoice itself. You should be able to get the numerical values that need to go into these values from the TaxCode/TaxRate endpoints.
Your best bet is to create the invoice in the UI and then load it through the API so you can see what it's meant to look like.
I have run into this as well and while it took me forever to figure it out, the answer is simple.
If tax is enabled for the company, every line must have a tax code, whether there is tax applied or not. That means that there should be a tax code in the system for "no tax". (For Australia, this is called "OOS" or "Out Of Scope" - apparently which one you get depends on when you set up tax, so look for both!)
If there is $0 tax for a particular line, you must explicitly attach this no-tax tax code, and cannot leave it null.
Is it possible to send fragmentRootElementName as a parameter to the job xml file. I have two processes one is plan and the other contract. So I divided my job into reading the file from database, converting it to an object and then publishing it in webservices. The reading part first reads a property file, there we get the info if the process is a plan or contract and accordingly we need to call the corresponding process. I did the one flow for plan but is it possible to pass the fragmentRootElementName as a prameter.. as it would be different for plan and contract
Thanks
Yes, you can using late-binding via scope="step" in this way:
<bean id="myReader" class="org.springframework.batch.item.xml.StaxEventItemReader" scope="step">
<property name="fragmentRootElementName" value="#{jobParameters['rootFragmentName']}" />
<!-- Other properties -->
</bean>